Thanos Architecture Overview
You'll learn how Thanos extends Prometheus to provide unlimited retention and globally unified queries across multiple clusters.
The Challenge Thanos Solves
Prometheus is fantastic for single-cluster monitoring, but struggles with two key limitations: limited local storage (disk fills up quickly with time-series data) and no global view across federated Prometheus instances. Thanos was built specifically to overcome these constraints.
What is Thanos?
Think of Thanos as a distributed extension layer for Prometheus. Instead of replacing Prometheus, it augments it by connecting multiple Prometheus servers and adding cheap, unlimited object storage (like S3 or GCS) for long-term metric retention.
Core Thanos Components
Sidecar: Runs alongside each Prometheus instance, uploading blocks to object storage and exposing a gRPC API for queries.
Store Gateway: Reads historical metric data directly from object storage, making old metrics queryable without loading them into Prometheus.
Querier: Provides a unified query interface that aggregates data from multiple Sidecars and Store Gateways. To applications, it looks like one giant Prometheus.
Compactor: Runs maintenance tasks on object storage—downsampling data for faster queries over long time ranges and compacting small blocks into larger ones.
Ruler: Evaluates recording and alerting rules across the global dataset (optional, but useful for global alerts).
Receiver (optional): Accepts remote-write data directly, eliminating the need for Prometheus servers in some scenarios.
How It Works Together
Multiple Prometheus servers scrape their local targets. Their Sidecars upload metric blocks to shared object storage. The Querier federates queries across all sources—recent data from Sidecars, historical data from Store Gateways—giving you a seamless global view with years of retention at low cost.
Key Takeaway: Thanos transforms Prometheus from a single-cluster tool into a globally scalable monitoring platform with unlimited, cost-effective metric storage using object stores.