What you will learn in this TP
- Configure Prometheus for Thanos
- Start the sidecar
- Check the blocks in the bucket
Introduction #
What you will learn in this section
- Configure Prometheus for Thanos
- Start the sidecar
- Check the blocks in the bucket
Context. Prometheus stores its data on local disk for only a few days and does not survive the loss of the server. You add Thanos Sidecar to automatically upload the blocks to shared object storage (MinIO).
Prerequisites: Docker Compose, basic Prometheus knowledge · Estimated time: 50 min
A first end-to-end Thanos pipeline.Setup #
Compose, configuration and verification.
1. Write the configuration files
Why? External labels uniquely identify each Prometheus: without them, Thanos can neither tell the sources apart nor deduplicate them.
Createprometheus.yml(external_labelsclusterandreplica) andbucket.ymlfor MinIO.2. Compose: MinIO, Prometheus and sidecar
Why? Prometheus must produce uncompacted 2-hour blocks: compaction is delegated to the Thanos Compactor to avoid conflicts.
Prometheus must produce uncompacted 2-hour blocks; the sidecar shares its volume.3. Validate
Why? Checking that the sidecar is ready and can see Prometheus saves you hours hunting for a block that will never be uploaded.
How do you check that the sidecar is ready and connected to Prometheus?4. Watch the blocks arrive
Why? Seeing a block land in the bucket is concrete proof that archiving works; you have to wait for the first block to be closed.
Once the first block has been closed (2 h), list the bucket.
Difficulty level : ●●○○○ (2/5)
My progress
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
Recommended Articles
Thanos: extending Prometheus (high availability, global view and long retention)
Understand why and how to use Thanos: Prometheus limits, components (Sidecar, Query, Store Gatewa...
Thanos Sidecar: attaching Thanos to Prometheus and uploading to object storage
Set up Thanos Sidecar: Prometheus settings (external labels, 2h blocks), objstore configuration, ...
Thanos best practices: architecture, storage, queries and operations
Thanos best practices: adopting components gradually, external labels, objstore, single compactor...
Deploying Thanos on Kubernetes (kube-prometheus-stack, Helm and Operator)
Install Thanos on Kubernetes: sidecar via kube-prometheus-stack, objstore secret, Bitnami/kube-th...
Thanos, Grafana Mimir or VictoriaMetrics: which long-term storage for Prometheus?
Detailed comparison of three long-term storage solutions for Prometheus: architecture, storage, h...
Thanos Receive: ingesting remote write and handling multi-tenancy
Use Thanos Receive: push mode with remote write, hashring, replication, multi-tenancy, Prometheus...
Mimir: compactor, retention and object storage
Configure Mimir object storage (S3, GCS, Azure, MinIO), understand compaction and split-and-merge...
Tempo: object storage, blocks, compactor and distributed deployment
Configure Tempo storage: S3/GCS/Azure, the vParquet4 Parquet format, WAL, compactor and retention...
Thanos Store Gateway and Compactor: history, downsampling and retention
Serve history with the Store Gateway and optimize storage with the Compactor: compaction, 5m/1h d...