General

The OpenTelemetry Cardinality Explosion: How High-Cardinality Spans Quietly Bankrupt SRE Teams

Oct 12, 2026/7 min read

calricon / field note

Adding user IDs, order IDs, and IP addresses to OpenTelemetry spans feels like an observability superpower until your monitoring bill quadruples and time-series databases crash. Discover why high-cardinality telemetry breaks traditional monitoring infrastructure and how elite SRE teams implement tail-based sampling and exemplars.

Oct 12, 2026/General
125
Advertisement

The OpenTelemetry Cardinality Explosion: How High-Cardinality Spans Quietly Bankrupt SRE Teams

The fastest way to crash your monitoring infrastructure and receive a panic-inducing six-figure cloud invoice is to let developers attach arbitrary business identifiers to OpenTelemetry instrumentation without governance. In modern cloud-native architectures, distributed tracing with OpenTelemetry (OTel) is hailed as the ultimate observability standard. Engineers enthusiastically instrument microservices, appending user_id, order_id, device_fingerprint, and client_ip as span attributes and metric dimensions to trace individual customer journeys. Thirty days later, time-series databases (Prometheus, VictoriaMetrics) suffer catastrophic out-of-memory kernel panics, SaaS observability platforms (Datadog, Honeycomb, Dynatrace) trigger massive high-cardinality overage penalties, and query latencies slow to a crawl. In enterprise SRE, high-cardinality telemetry is a double-edged sword: without deliberate tail-based sampling and structural aggregation, the financial cost of observing your software quickly outpaces the cost of running it.

The core premise is stark: traditional monitoring architectures were built for low-cardinality infrastructure signals (CPU, memory, hostnames), not millions of unique transactional permutations. When engineering teams inject high-cardinality dimensions into uncurated telemetry pipelines, they trade operational clarity for an unsustainable data ingestion tax.

The Mathematics of Cardinality Explosions

To understand why cardinality breaks monitoring infrastructure, look at the combinatorial math of multi-dimensional telemetry:

  • A basic HTTP request metric might track method (GET, POST, PUT), status_code (200, 404, 500), and service_name (cart, checkout, payment). Total unique time series: 3 * 3 * 3 = 27.
  • An engineer adds tenant_id across 1,000 business accounts: 27 * 1,000 = 27,000 time series.
  • Another engineer adds user_id across 500,000 active users: 27,000 * 500,000 = 13.5 billion potential time series.

In time-series databases (TSDBs), every unique permutation of label key-value pairs allocates an independent inverted index entry in RAM. When cardinality surges into millions of distinct streams, TSDB memory heads explode, disk block compaction stalls, and queries spanning thirty minutes time out.

In commercial SaaS monitoring platforms, vendor billing models heavily penalize custom metric cardinality and uncurated span ingestion. A single unvetted pull request adding an ephemeral UUID as a metric tag can inflate a monthly telemetry bill from $12,000 to $65,000 in a single billing cycle.

"Observability without cardinality is generic monitoring; cardinality without governance is financial suicide. Ingesting millions of uncurated spans turns your monitoring tool into your largest cloud invoice."

The Fatal Trap: Naive Head-Based Sampling

When teams realize their OpenTelemetry volume is financially unsustainable, their first instinct is to implement head-based sampling at the application layer (e.g., configuring an SDK sampler to retain 5% of all traces randomly at request ingress).

Head-based sampling is an operational disaster:

  1. Probabilistic Blindness: The decision to record or drop a trace is made at the root span, before the request ever touches downstream services. If a catastrophic database deadlock or payment gateway 500 error occurs deep inside a microservice call graph, there is a 95% probability that the entire trace was already discarded at the edge.
  2. Incomplete Call Graphs: In distributed systems, if upstream and downstream services use decoupled sampling logic, you end up with orphaned trace fragments—spans with missing parents and incomplete spans—making latency root-cause analysis impossible.
  3. Zero Visibility for Low-Volume High-Value Incidents: When an enterprise VIP customer encounters a Sev-1 billing failure that occurs 10 times a day amidst 10 million background health checks, random 5% sampling virtually guarantees that zero failure traces will survive ingestion. The SRE team is left completely blind during active post-mortems.

The Modern Telemetry Playbook: Engineering High-Cardinality Sanity

Elite SRE organizations do not ban high-cardinality context; they decouple ingestion from indexing using modern collector architecture:

  • Implement Tail-Based Sampling in the OpenTelemetry Collector: Stop sampling at the application root. Route 100% of raw spans from application runtimes to an internal cluster of OpenTelemetry Collectors deployed as a dedicated tier.

    Configure the OTel Collector tail_sampling processor:

    • Buffer all spans for a specific trace_id in memory or fast local NVMe storage until the entire trace completes (typically 3–5 seconds).
    • Apply intelligent filtering rules:
      • If a trace contains status.code == ERROR or HTTP status >= 500: Retain 100%.
      • If P95/P99 latency threshold is breached (e.g., duration > 1,500ms): Retain 100%.
      • If specific VIP tenant_id is present: Retain 100%.
      • If the trace is a routine 200 OK health check or static asset load: Sample down to 0.1%.
    Tail-based sampling slashes total ingested span volume by 80% to 90% while guaranteeing that every single production incident, error, and latency anomaly is preserved with full high-cardinality context.
  • Replace High-Cardinality Metrics with Prometheus Exemplars: Never store transactional IDs in metric labels. If an SRE needs to jump from a latency spike chart directly to a specific slow request, use OpenTelemetry Exemplars:
    • Record metrics with clean, low-cardinality dimensions (service, route, status_code).
    • Attach high-cardinality metadata (the specific trace_id and user_id) as an exemplar—a non-indexed metadata reference attached to a specific metric data point.
    • When an engineer inspects a latency spike in Grafana, clicking on an individual outlier data point immediately opens the exact distributed trace in Jaeger, Tempo, or Honeycomb without forcing the TSDB to index millions of unique time series.
  • Enforce Attribute Sanitization and Masking at the Collector Layer: Deploy the OTel Collector transform (OTTLL) and attributes processors to enforce corporate governance before data leaves your network boundary:
    • Hash or drop ephemeral UUIDs, session cookies, and credit card patterns from span attributes.
    • Bucket continuous variables: instead of recording raw byte counts as discrete values, bucket them into logarithmic ranges (e.g., <10KB, 10-100KB, >100KB).
    • Drop redundant debug attributes in production environments, ensuring only production-relevant operational signals traverse the wire.
  • Establish Telemetry FinOps Budgets by Domain: Treat observability data like cloud compute. Attribute telemetry ingestion volume back to specific engineering squads using OTel resource attributes (service.namespace, team.owner). When a product team pushes an unoptimized SDK release that floods the cluster with millions of redundant debug spans, automated alerting flags the spike to the team lead before month-end invoices arrive.

The Strategic Verdict

Observability without cardinality is generic monitoring; cardinality without governance is financial suicide. If your SRE team is forced to randomly discard 95% of trace data just to keep monitoring invoices under control, your observability strategy has failed.

Deploy an OpenTelemetry Collector tier, mandate tail-based sampling to capture 100% of failures, link low-cardinality metrics to traces using exemplars, and stop letting uncurated telemetry dictate your cloud budget. In modern reliability engineering, intelligent sampling is the difference between total visibility and blind bankruptcy.

Advertisement
Talk to Calricon