Skip to content
BENIBIX Learn

Metric Cardinality

Infrastructure📈 Monitoring & ObservabilityTelemetry Signals

Also known as High Cardinality, Label Cardinality, Cardinality Explosion

How many series a metric makes. Each mix of labels adds one.

Think of it like

Think of it like sorting socks. Sort by color and you get a few piles. Sort by owner and every sock needs its own pile.

Example

Emma adds a user ID label to her request count. She has 200,000 users, so one metric turns into 200,000 series. Her server runs out of memory.

Why it matters

Cost and speed grow with the number of series. One careless label can slow every dashboard and alert.

Definition

Metric cardinality is the number of separate time series a metric creates. A metric can carry labels, such as the page or the status code. Every new mix of label values starts a new series that has to be stored. A label with a few values is cheap. A label with millions of values, like a user ID, can make millions of series. That can swamp the whole system.
A label with three values makes three series. A label with a user ID makes one series for every user.

Common mistake

Putting IDs, emails or full web addresses in labels. Keep labels to small, fixed sets, and put the details in logs.

Key takeaways

  1. 1
    One series per mix. Each mix of labels is stored apart.
  2. 2
    Few values are cheap. Status codes, regions, methods.
  3. 3
    No endless labels. User IDs belong in logs.