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

Prometheus CPU is pegged at 100% but ingestion is flat

IntermediateTroubleshootingPrometheus storage, memory and cardinality
Answer

Likely causes → Expensive queries: dashboards auto-refreshing every 5s over 7d, regex matchers like {__name__=~".*"}, or slow rule groups.

Diagnose → Enable --query.active-query-tracker/query log (global.query_log_file), then:

topk(10, prometheus_rule_group_last_duration_seconds)
rate(prometheus_engine_query_duration_seconds_sum[5m])

Fix → Increase dashboard refresh intervals, replace hot queries with recording rules, and kill bad ones.

Prevent → Put a query frontend (Thanos/Mimir) with caching in front for heavy dashboards.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus storage, memory and cardinality