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.
More on Prometheus storage, memory and cardinality
Prometheus pod restarts with `OOMKilled` every few hoursIntermediateA query fails with `query processing would load too many samples into memory in query execution`IntermediatePrometheus logs `opening storage failed: ... unexpected EOF` / `corruption in segment` and won't startAdvancedPrometheus is in CrashLoopBackOff with `no space left on device`BeginnerPrometheus takes 15 minutes to become ready after a restartAdvancedPrometheus is killed by the liveness probe during startup in a loopIntermediate