RousselTMLEARNING

TP · Thanos: from discovery to expertise

Lab: Prometheus + Thanos Sidecar + MinIO

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. 1. Write the configuration files

    Why? External labels uniquely identify each Prometheus: without them, Thanos can neither tell the sources apart nor deduplicate them.

    Create prometheus.yml (external_labels cluster and replica) and bucket.yml for MinIO.
  2. 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. 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. 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

  • ⏱ Estimated time : ≈ 50 min

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.

Ask a question about this lesson →

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...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!