ObservabilityIntermediate

OpenTelemetry in Production: Sampling, Cardinality, Cost

DeveloperHat Team
12 min read

TL;DR

OpenTelemetry graduated at the CNCF in May 2026. In production, cost comes from sampling, cardinality, and retention — here is how to control all three.

OpenTelemetry is the default answer to "how should we instrument this?" — and since it graduated at the CNCF in May 2026, it is no longer a bet on a standard, it is the standard. The instrumentation part is the easy part. The hard part, the part that shows up in the invoice and the 3 AM page, is what happens after the spans leave your services: how much you keep, how many distinct series your labels create, and how long you retain it all.

The short version: instrument everything with the SDK, keep a small fixed fraction of traces with head sampling, keep all of your errors and slow traces with tail sampling, never put an unbounded identifier in a metric label, and generate your RED metrics from traces so sampling never blinds your dashboards. The rest of this guide is the evidence behind those five sentences — and the cases where each of them is wrong.

One pipeline, three signals Instrument once with the SDK; the Collector decides what leaves the cluster. SIGNALS Traces where time went Metrics how it behaves Logs what happened Collector batch · sample · route Backend Tempo · Mimir · Loki One instrumentation layer, any OTLP backend — the vendor switch happens at the Collector.

Where OpenTelemetry stands in late 2026

Before standardising on anything, check what is actually stable. The project tracks maturity per signal and per component on its specification status page, and the picture in November 2026 is uneven in ways that matter for planning:

SignalAPISDKProtocol (OTLP)What it means for you
TracesStableStableStableAdopt as the default; covered by long-term support
MetricsStableMixedStableAdopt, but check your language SDK's maturity first
LogsStable (Bridge API)StableStableAdopt through the Bridge API; language support varies
ProfilesDevelopmentDevelopmentDevelopmentPublic alpha since 26 March 2026 — pilot only, not for critical production workloads

Two details deserve attention. First, the semantic conventions — the attribute names your dashboards and alerts depend on — are maturing at different speeds: database conventions are mostly stable, while messaging conventions are still in development, and the GenAI conventions for LLM spans moved into their own repository with semantic conventions v1.42.0 in June 2026 and are still seeing renames. Pin your convention version and do not upgrade it casually. Second, the current specification release is v1.61.0 (September 2026), and OTLP 1.11 is stable for traces, metrics, and logs — the protocol is the part you can rely on even while individual SDKs catch up. If you are still choosing the surrounding stack, start with our Kubernetes monitoring and observability guide.

Option 1: Head sampling — decide at the root

Head sampling makes the keep-or-drop decision when the root span starts, before anything about the request is known. The decision travels downstream in the sampled flag of the W3C traceparent header, so every service in the chain reaches the same conclusion. The standard production configuration is a parent-based sampler wrapping a trace-ID-ratio sampler, and it needs no code changes:

# Keep ~10% of traces, decided once at the root, honoured downstream
export OTEL_TRACES_SAMPLER=parentbased_traceidratio
export OTEL_TRACES_SAMPLER_ARG=0.1

The ratio sampler is deterministic: it hashes the trace ID, so every service evaluating the same trace ID independently reaches the same answer, and you get whole traces instead of fragments. The parent-based wrapper is what makes that work — without it, each service rolls its own dice and a trace crossing five services is kept by some and dropped by others. The SDK default is parentbased_always_on, which records everything; changing that one environment variable is the single highest-leverage production change most teams have not made.

Its strength is also its limit. Head sampling is cheap — dropped spans are never created, exported, or stored — but it decides before the request has done anything, so at 10% it discards 90% of your errors along with 90% of everything else. It suits high-volume, homogeneous traffic where individual requests are interchangeable: health-check-heavy APIs, uniform read paths. It is the wrong tool when the traces you need are exactly the rare ones — the one-in-a-thousand checkout failure, the p99 latency spike.

Option 2: Tail sampling — decide after the trace finishes

Tail sampling moves the decision into the OpenTelemetry Collector: every service exports all spans, the Collector buffers each trace until it is complete, then keeps it if it matches a policy — any span errored, the trace was slow, the route was /checkout — plus a small random baseline. The tail_sampling processor lives in the Collector contrib distribution and is beta for traces:

processors:
  tail_sampling:
    decision_wait: 10s
    num_traces: 100000
    expected_new_traces_per_sec: 2000
    policies:
      - name: keep-errors
        type: status_code
        status_code:
          status_codes: [ERROR]
      - name: keep-slow
        type: latency
        latency:
          threshold_ms: 2000
      - name: baseline
        type: probabilistic
        probabilistic:
          sampling_percentage: 5

Three operational facts decide whether this fits. First, all spans of a trace must reach the same Collector instance, because the decision is made from the assembled trace — that forces a two-layer deployment (agents forwarding to a stateful sampling tier) once you outgrow one Collector. Second, the processor is stateful: every span is held in memory until decision_wait fires (default 30 seconds, num_traces default 50,000), so a traffic spike becomes a memory spike on the Collector before it becomes anything else. Third, it costs full collection up to the Collector — SDK overhead, network, and Collector CPU are all paid for spans you will then throw away. The two options compose well: head sampling first to cut obvious volume, tail sampling second to select from what remains.

Two decision points, different knowledge Head sampling decides before the request runs; tail sampling decides after it finishes. Head sampling SDK · at the root span Tail sampling Collector · after completion Cheap · blind to errors dropped spans never exist Sees errors · costs memory every span buffered first Head sampling saves money at every stage; tail sampling saves the traces that matter.

The cardinality problem

Traces are not where most observability bills explode. Metrics are — and the mechanism is arithmetic, not volume. Every unique combination of label values is a separate time series, and labels multiply: three HTTP methods, five status codes, and fifty routes is 750 series for one latency metric, and adding a ten-value region label makes it 7,500. Classic Prometheus histograms multiply again — eleven buckets plus +Inf, _sum, and _count means 14 series per label combination. The numbers behind that are worth internalising: field reports converge on roughly 3–4 KB of RAM per active series in Prometheus, or about 25 MB per 1,000 series, so a million active series is several gigabytes of head-block memory before a single query runs. Mid-sized production environments typically sit between 100,000 and 2 million series; past 5 million you have a problem, and past 10 million it is urgent.

The offenders are always the same: user IDs, request IDs, session tokens, IP addresses, full URL paths — values that are unbounded by construction. Prometheus's own naming guidance is blunt about it: the vast majority of metrics should have no labels at all, and high-cardinality dimensions belong in traces or logs, where a unique value is just one more event, not one more series. The number to watch is prometheus_tsdb_head_series — sudden growth without matching traffic growth is the signature of a cardinality bomb, and it is the one chart that tells you a bad label landed before the OOMKill does:

# Top 20 metrics by series count — the first place to look
topk(20, count by (__name__) ({__name__!=""}))

Three defences work in practice, in order of leverage: drop the label at the Collector with a transform processor before it is ever stored; pre-aggregate at the Collector so the backend only sees the rolled-up series; and set a cardinality budget per team or service and alert on it the way you alert on error budgets. The Kubernetes architecture guide covers where the Collector itself runs in the cluster, which matters once it becomes the chokepoint for all three signals.

What the bill is made of

Every vendor meters something different, and the meter decides which of your habits gets expensive. Four meters cover the market: per gigabyte ingested (Grafana Cloud, New Relic), per active series (Grafana Cloud metrics), per event or span (Honeycomb, Sentry), and per host (Datadog APM). The same estate costs a different amount under each, so compare meters before comparing prices. List prices as published on vendor pages in November 2026, from a pricing comparison that read them that month:

VendorMeterHeadline list price
Grafana Cloud ProPer GB + per series$19/mo platform fee (incl. 10,000 series, 50 GB traces); traces $0.55/GB all-in at 30-day retention; $6.50 per 1,000 series over allowance
Honeycomb ProPer event$150/mo for 50M events; $3.00 per million events (rate set 1 July 2026); every span counts as one event
Datadog APMPer host$31 per APM host/mo on annual billing; trace ingestion $0.10/GB plus indexed spans

List prices change and everyone negotiates — treat these as the shape of the bill, not a quote. The shape is what matters: under a per-GB meter, retention is the lever (30 days costs roughly three times 10 days, because you pay to process, write, and retain); under a per-series meter, labels are the lever; under a per-event meter, span count is the lever, and a chatty service emitting twenty spans per request pays twenty times a quiet one. Two cost controls work under every meter. First, retention tiers: keep full-fidelity traces for days, sampled traces for weeks, and aggregated metrics for months — nobody debugs a Tuesday incident from March. Second, span metrics: the Collector's spanmetrics connector generates RED metrics (rate, errors, duration) from the full trace stream, so you can sample traces down to 1% and your dashboards and alerts stay complete. Sampling traces without span metrics is how teams save money and lose the ability to see a regression.

The comparison

Always-onHead samplingTail sampling
Decision madeNever — keep everythingAt the root span, in the SDKAfter the trace completes, in the Collector
Keeps errors and slow tracesYes, all of themOnly the sampled fractionYes, by policy
Cost up to the CollectorFullReduced — dropped spans never existFull
Cost after the CollectorFullReducedReduced
Operational weightNoneOne env varStateful Collector tier, memory sizing
Best forLow-volume services, dev, the first monthHigh-volume homogeneous trafficError and latency investigation at scale

Where does the money go first? Find the biggest meter, then pull its lever — not the other way round. Telemetry bill too high? check the meter first Traces dominate sample harder · span metrics Metrics dominate cut labels · budget series Logs dominate drop debug · tier retention Retention tiers and span metrics work under every meter — apply them before renegotiating.

Recommendation

Start where the cost curve is steepest and the risk is lowest. Set parentbased_traceidratio at 10% on every service on day one — it is one environment variable, it is reversible in a deploy, and it typically cuts trace volume by an order of magnitude. Add the spanmetrics connector in the Collector at the same time, so the metrics your alerts depend on are computed from the unsampled stream. Put a cardinality budget in place before the first custom metric ships: no unbounded label values, a weekly review of prometheus_tsdb_head_series, and a rule that any new label needs a named owner. Only then, when you can say which traces you miss, add tail sampling for the two policies that pay for themselves — keep all errors, keep traces slower than your p99 SLO — plus a 5% probabilistic baseline so the backend still has a representative sample. That stack — head sampling, span metrics, tail sampling for the interesting traces — is what production OpenTelemetry looks like in late 2026, and it survives the volume growth that kills always-on setups.

When not to use

Do not reach for tail sampling first. If your services emit a few hundred spans a second, always-on is cheaper than the Collector tier tail sampling needs, and the operational cost of a stateful component exceeds the storage you would save. Do not sample traces before span metrics are in place — you will trade a smaller bill for dashboards that cannot see a 5% error-rate regression. Do not put OpenTelemetry profiles on a critical production path yet: continuous profiling is in public alpha since March 2026 and the project itself advises against relying on it for critical workloads. And if your workload is edge inference or another high-volume, low-margin shape, budget telemetry as a line item per request before you instrument — at the edge, the observability cost can exceed the compute cost of the request itself, and that is a design input, not a surprise for the invoice.

How long this guidance stays current

Versions and dates in this guide are as of November 2026: specification v1.61.0 (September 2026), OTLP 1.11, semantic conventions v1.44.0, CNCF graduation May 2026, profiles public alpha March 2026. The parts that age fastest are the SDK maturity table — check your language's status before standardising — and the GenAI semantic conventions, which are still in development and still being renamed. The parts that do not age are the mechanics: sampling is a decision about when you know enough to choose, cardinality is multiplication, and every vendor's meter punishes a different habit. Re-check the specification status page and the vendor pricing pages before you commit a convention across teams.

Why This Matters

Understanding the business and technical context helps you make informed decisions rather than blindly following patterns.

Trade-offs to Consider

Every architectural decision involves trade-offs. Consider your specific requirements, team expertise, and scale when evaluating options.

When NOT to Use This

Knowing when a solution doesn't apply is as valuable as knowing when it does. Consider alternatives for your specific situation.

Decision Framework

Use this framework to evaluate whether this approach is right for your use case based on your specific constraints and requirements.

Share this articleShare on XShare on LinkedIn

Keep the decision frameworks coming

One practical architecture guide a week — patterns, trade-offs, and when not to use them. No spam, unsubscribe anytime.