Interview Prep/Monitoring & Observability/Long-Term Storage, Scale and Cost

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 →

  1. Prometheus TSDB status:
    curl -s localhost:9090/api/v1/status/tsdb | jq '.data.seriesCountByMetricName[:10], .data.labelValueCountByLabelName[:10]'
    
  2. Count by namespace and metric:
    topk(20, count by (namespace) ({__name__=~".+"}))
    topk(20, count by (__name__) ({__name__=~".+"}))
    
    Run these on a recording rule or off-peak; they are expensive.
  3. In Mimir/Grafana Cloud, use the cardinality management dashboards and API.
  4. 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.

All Monitoring & Observability questions

More on Long-Term Storage, Scale and Cost