Prometheus Cardinality Estimator
Estimate Prometheus series count, head-block memory, and disk usage from a metric name and label dimensions. Spot the high-cardinality offender before it OOM-kills your Prometheus.
Labels
| Label name | Estimated unique values | |
|---|---|---|
Watch the highest-cardinality labels — instance, user_id, request_id are common offenders. Aim to keep total series under 1M per Prometheus.
Total active series
480.0k
480,000
Memory (head block)
1.4 GB
~3 KB per active series
Disk (15d retention)
50.2 GB
@ 15s scrape interval
Highest-cardinality label
instance has 200 unique values and is multiplying everything else by that factor.
Dropping this label (via metric_relabel_configs in your scrape config) would reduce series from 480.0k to 2.4k.
metric_relabel_configs:
- source_labels: [__name__]
regex: http_requests_total
action: replace
target_label: instance
replacement: ''Automate your incident response
Reduce MTTR by 90% with AI-powered root cause analysis. Free to start.
Why cardinality is the #1 Prometheus pitfall
Prometheus stores one time series per unique combination of label values. That sounds harmless until you realize the math is multiplicative. Three labels with 50, 200, and 8 unique values is not 258 series — it is 50 × 200 × 8 = 80,000 series. Add a single high-cardinality label (user_id with 100k values) and you are at 8 billion. That is when the OOM-killer comes for your Prometheus pod.
The labels you should never label-ify
- user_id, session_id, request_id — unbounded values that grow with traffic
- raw URL paths — every dynamic segment becomes a new value (use route patterns instead:
/users/:id) - error messages with embedded data — strip the dynamic parts before using as a label
- IP addresses, user agents — practically unbounded
- timestamps in any form — never a label, always a sample value
Bucket instead of label
For continuous values (latency, response size, queue depth), use histogram buckets rather than raw values as labels. A latency histogram with 10 buckets has 10x fewer series than labeling raw latency values. Prometheus client libraries make this easy with Histogram or Summary types.
From metrics to incidents
Cardinality discipline keeps Prometheus fast and your bill manageable — but observability metrics are only useful if you can reason across them during an incident. Uptimes.ai is an AI SRE agent that queries Prometheus, Datadog, eBPF, and Kubernetes state simultaneously when an alert fires, producing a root cause report in under three minutes. The same multi-source reasoning a senior SRE does manually, automated.