`promtool tsdb analyze` shows a label with 1.2M unique values
IntermediateTroubleshootingPrometheus storage, memory and cardinality
Answer
Likely causes → An unbounded value used as a label: IPs, session IDs, full URLs, timestamps.
Diagnose →
promtool tsdb analyze /prometheus | sed -n '/Highest cardinality labels/,/^$/p'
Fix → Remove it from instrumentation; meanwhile labeldrop it or drop the metric. If you need the detail, put it in logs or traces and link via exemplars.
Prevent → Lint metrics in code review; labels should have bounded values (tens to hundreds).
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`IntermediateHead series jumped from 2M to 9M after a deployAdvancedPrometheus 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 restartAdvanced