Mitigating High-Cardinality Telemetry Explosions in Ingestion Pipelines
Scenario Prompt:
“After a new microservice release, your Prometheus TSDB memory consumption triples in 20 minutes, causing OOM crashes. You discover a developer added user_id="<uuid>" as a label to the http_requests_total metric. How do you resolve this immediately and prevent recurrences?”
Substantive Technical Concepts to Hit:
Understanding Metric Cardinality
Every unique combination of label key-value pairs creates a new time-series in memory. Adding millions of unique user UUIDs produces millions of parallel time-series, consuming gigabytes of RAM.
Metric Relabeling & Dropping
Apply a metric_relabel_configs rule in Prometheus or an OTel Collector processor to strip the user_id label before data touches the TSDB.
Logging vs Metrics Separation
Educate developers that high-cardinality identifiers belong in structured logs or distributed trace span attributes, not in time-series metric labels.
Automated CI Linting for Telemetry
Implement pre-merge linting rules that reject metric definitions containing known unbounded identifier names.
- Can we immediately deploy a Prometheus relabeling config reload without taking down the monitoring stack?
- Is an OpenTelemetry Collector deployed between the application pods and the Prometheus server to filter the label upstream?
- Do we need to retain the per-user data in our log aggregator (Loki/OpenSearch) for billing or fraud analysis?