How do you make Prometheus itself highly available?
IntermediateProductionScaling Prometheus, Long-Term Storage & HA
Answer
Run two identical replicas scraping the same targets, with an external label distinguishing them:
global:
external_labels:
cluster: prod-eu-1
replica: prom-0
Both send alerts to the Alertmanager cluster, which deduplicates. For queries, Thanos Query deduplicates with --query.replica-label=replica, and Mimir's HA tracker (accept_ha_samples: true, ha_cluster_label: cluster, ha_replica_label: replica) accepts samples from one replica at a time. The Prometheus Operator does this with replicas: 2.
More on Scaling Prometheus, Long-Term Storage & HA
What are the practical limits of a single Prometheus server?IntermediateWhen does hierarchical federation still make sense?IntermediateHow do you shard Prometheus scraping, and what do you lose?AdvancedCompare Thanos, Grafana Mimir and VictoriaMetrics.AdvancedThanos sidecar versus Thanos Receive: how do you choose?AdvancedWhat is Prometheus agent mode and when do you use it?Intermediate