You need to know which team and which metric generate the most series. How do you find out?
IntermediateScenarioLong-Term Storage, Scale and Cost
Answer
Situation read → You need cardinality attribution before you can manage cost.
What I'd do →
- Prometheus TSDB status:
curl -s localhost:9090/api/v1/status/tsdb | jq '.data.seriesCountByMetricName[:10], .data.labelValueCountByLabelName[:10]' - Count by namespace and metric:
Run these on a recording rule or off-peak; they are expensive.topk(20, count by (namespace) ({__name__=~".+"})) topk(20, count by (__name__) ({__name__=~".+"})) - In Mimir/Grafana Cloud, use the cardinality management dashboards and API.
- Map namespaces to teams with an ownership label and publish a weekly report.
Why → You cannot reduce what you cannot attribute.
Interview tip → Mention churn too: prometheus_tsdb_head_series_created_total shows short-lived series that never appear in snapshots.
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