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

`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).

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus storage, memory and cardinality