Histograms are 60% of all series in your Prometheus. How do you reduce them?
IntermediateScenarioLong-Term Storage, Scale and Cost
Answer
Situation read → Each classic histogram creates one series per bucket per label set; 20 buckets × many labels adds up fast.
What I'd do →
- Find the largest:
topk(10, count by (__name__) ({__name__=~".+_bucket"})). - Reduce buckets to those around the SLO thresholds (8–12 buckets).
- Remove high-cardinality labels from histograms (e.g. full path, pod).
- Drop unused histograms at scrape with
metric_relabel_configs. - Evaluate native histograms, which store all buckets in one series.
Why → Histogram cost = buckets × label combinations.
Interview tip → Keep the _count and _sum series even if you drop the buckets; they still give rate and average.
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?AdvancedGrafana shows every series twice after you added a second Prometheus replica with Thanos. How do you fix it?IntermediateRemote 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?Intermediate