Someone adds customer_id to a metric because it would be useful to break down errors by customer. It is useful. The next invoice is four times larger, and nobody connects the two events for a month.
Cardinality is the most common way observability costs escape, and it's almost always introduced by a change that looked trivial in review.
The multiplication
A time series is identified by its metric name plus the full set of label values. Each distinct combination is a separate series, stored and indexed separately.
Start with:
http_requests_total{method, status, endpoint}
Five methods, eight statuses, forty endpoints. Up to 1,600 series — small, and most backends handle it without noticing.
Add customer_id with 5,000 customers, and the ceiling becomes 8,000,000. In practice not every combination occurs, but the growth is multiplicative, and — importantly — it grows with your business. The metric that was fine at launch becomes the largest line on the bill at scale, without anyone changing it again.
The costs aren't only storage. High cardinality slows queries, inflates memory in the ingestion path, and can affect the reliability of the monitoring system itself. Losing your dashboards during an incident because a label was added in a routine PR is a bad way to find out.
What belongs in a label
A workable test, applied to each label before it's added:
Is the set of values bounded and small? Status codes, regions, environments, job kinds, boolean flags — bounded. IDs, emails, URLs with parameters, timestamps, error messages — unbounded. Unbounded values should never be labels.
Will you ever group by it on a dashboard? Labels exist so you can slice an aggregate. If you'd never build a chart broken down by this field, it doesn't need to be a label.
Does it grow with usage? Anything proportional to customers, users, files or requests is a trap. It's fine today and it's a bill later.
Would you accept the cost at 10× today's scale? Cardinality decisions are effectively permanent, because removing a label breaks every dashboard and alert built on it.
Where the high-cardinality data should go
The instinct behind adding customer_id is correct — per-customer investigation is genuinely necessary. The mistake is the destination.
High-cardinality dimensions belong in wide events, where customer_id is a column value rather than a new time series. Columnar stores compress repeated values well, and filtering by one customer is a scan over a column, not a lookup across millions of index entries.
The division that works:
- Metrics answer is something wrong — aggregate rates, latencies, saturation. Few labels, all bounded, cheap to retain for a year.
- Events answer what exactly happened — one wide row per unit of work, every identifier you have, retained for weeks rather than years.
- Metrics derived from events where possible, so the two can't disagree.
Reach for metrics for alerting, events for investigation. Most cardinality incidents are someone trying to make metrics do the investigation job.
Practical controls
Enforce a label allowlist. A metrics wrapper that rejects unknown labels catches the problem at the point of introduction. Reviewers don't reliably notice customer_id in a diff; a failing test does.
Alert on series count, not just on cost. Series count is a leading indicator; the invoice is a trailing one by up to a month. Track new series per day and alert on a sudden rise.
Make the top cardinality contributors visible. Most backends can report which metrics and labels produce the most series. Put that on a dashboard someone looks at. Unattributed cost gets ignored; attributed cost gets fixed.
Watch for accidental unboundedness. The subtle cases aren't obvious IDs — they're an error label carrying an exception message with a record ID in it, an endpoint label built from a raw path including parameters, or a version label that increments every deploy. These pass review because the field name looks bounded.
When you actually need per-entity metrics
Sometimes the requirement is real — per-customer SLOs in a contract, for instance.
Options, in rough order of preference:
- Derive from events at query time. No permanent series, cost proportional to how often you ask.
- Limit the set. Emit per-customer series only for accounts that warrant it — the fifty with contractual SLOs, not all five thousand — with everything else in an
otherbucket. - Pre-aggregate. Compute per-customer rollups on a schedule into a table, and query that. More machinery, predictable cost.
- A separate backend for the high-cardinality workload, sized and priced for it.
What doesn't work is adding the label to an existing metric and hoping. That's the path that produces the surprise invoice.
The habit
Treat every new label as a spending decision, and say out loud what it costs: "this multiplies the series count by the number of customers." Phrased that way, the conversation usually resolves itself, and the useful version of the request — per-customer investigation — gets routed to the system built for it.
Turn one person's AI process into the company's.
Murmurator is invite-only. Already invited? Sign in and build something real.