Interview Prep/Monitoring & Observability/Cardinality Control & Cost

How do you handle a cardinality explosion that is happening right now?

IntermediateProductionCardinality Control & Cost
Answer
  1. Identify the metric and job via TSDB status or topk(10, count by (__name__, job) ({__name__=~".+"})).
  2. Stop the bleeding: add a metric_relabel_configs drop or labeldrop for that job, or set sample_limit, and reload Prometheus (curl -X POST /-/reload with --web.enable-lifecycle).
  3. Notify the owning team to fix instrumentation.
  4. Head memory drops after the next head compaction (every 2 hours).

Prevent with limits and instrumentation review.

All Monitoring & Observability questions

More on Cardinality Control & Cost