Grafana shows every series twice after you added a second Prometheus replica with Thanos. How do you fix it?
IntermediateScenarioLong-Term Storage, Scale and Cost
Answer
Situation read → The HA pair scrapes the same targets; Thanos Querier is not deduplicating.
What I'd do →
- Give each replica a distinguishing external label, everything else identical:
global: external_labels: { cluster: prod-eu, replica: prometheus-0 } - Start the Querier with the replica label:
thanos query --query.replica-label=replica --endpoint=dnssrv+_grpc._tcp.thanos-store - Make sure Grafana's datasource does not disable deduplication (the
dedup=trueparameter is the default). - For the compactor, set
--deduplication.replica-label=replicato deduplicate stored blocks too.
Why → Deduplication merges series that differ only by the replica label and fills gaps from the other replica.
Interview tip → With the Prometheus Operator, the prometheus_replica label is added automatically; use that as the replica label.
More on Long-Term Storage, Scale and Cost
Prometheus keeps 15 days of data, but leadership wants 13 months of metrics for capacity planning. What do you build?IntermediateThe Thanos compactor has halted and the bucket keeps growing. What do you do?AdvancedRemote write to your central store is falling further behind every hour. How do you handle it?AdvancedMimir rejects writes from a team with `err-mimir-max-series-per-user`. What do you do?IntermediateYour observability SaaS bill tripled in a quarter, driven by custom metrics. How do you bring it down?IntermediateYou must choose between Thanos and Mimir for a new long-term metrics platform. How do you decide?Advanced