Interview Prep/Monitoring & Observability/Prometheus storage, memory and cardinality

Head series jumped from 2M to 9M after a deploy

AdvancedTroubleshootingPrometheus storage, memory and cardinality
Answer

Likely causes → A new label with unbounded values: user_id, request_id, raw URL path, trace_id, error message, or pod churn from a crash loop.

Diagnose →

topk(10, sum by (job) (scrape_series_added))
count by (__name__)({job="checkout"})
count(count by (path) (http_requests_total{job="checkout"}))

TSDB Status page lists "Top 10 label names with high value count".

Fix → Short term: drop the label at ingest:

metric_relabel_configs:
  - action: labeldrop
    regex: path

Long term: route templating in code (/users/:id, not /users/42) and roll back the instrumentation change.

Prevent → sample_limit per job, a cardinality budget per team, and review of new metrics in PRs.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus storage, memory and cardinality