What It Costs: the Bill Is Per-Span, the Value Is Per-Trace

The Running Example

One scenario, carried through the rest of the guide. A checkout path at 10,000 req/s across 23 services, averaging 40 spans per trace (each service contributes a server span, one or two client spans, and a couple of internal ones — see the Span and Instrumentation parts for why that number is what it is).

spans/s = RPS × spans-per-trace = 10,000 × 40 = 400,000 spans/s
spans/day = 400,000 × 86,400 = 34.56 billion

Span size: The Span part's anatomy gives you a 16-byte trace ID, an 8-byte span ID, two timestamps, a name, a status, and — dominating everything — the attribute map. A span carrying the stable HTTP semantic conventions (http.request.method, url.path, http.response.status_code, server.address, network.peer.address) plus a handful of app-specific keys lands in the 500–900 byte range once the keys and values are counted as strings, before any resource attributes are amortised across the batch. 700 bytes/span is the estimate used throughout this part — a modelling assumption, not a measurement. Two calibration points are worth carrying: The Span part budgets a 10-attribute span at ~535 B, and Dapper measured 426 B averaged across Google's whole production fleet, so 700 B is deliberately the pessimistic end. One caveat that bites people who go and measure: OTLP amortises resource attributes per ResourceSpans group, not per batch. On a sidecar agent, whose batch is one pod, that dedup is real and bytes/span falls; on a gateway, whose batch spans hundreds of pods, it barely applies. The same fleet measured at the two tiers differs by roughly 20–40% — so record where you measured, or your cost model will not reproduce (see The Collector).

Raw volume34.56e9 × 700 B ≈ 24 TB/day
On the wireOTLP protobuf + gzip ≈ 5:1 → ~4.8 TB/day
In columnar storageParquet/ClickHouse ZSTD ≈ 10:1 → ~2.4 TB/day
At 1% sampling~240 GB/day uncompressed → ~7.2 TB/month billed

Columnar compresses better than the gzipped wire stream for a structural reason, not a magic one: on the wire, spans are serialised whole and gzip only sees a 32 KB window; in a Parquet or ClickHouse block, every service.name in a row group is adjacent and dictionary-encoded, every timestamp is delta-encoded, and every http.request.method collapses to a handful of dictionary entries. 10:1 is a defensible middle estimate — real numbers run 6:1 to 20:1 depending almost entirely on attribute repetition.

Four Buckets, Four Different Levers

People say "the tracing bill" as if it were one number. It is four, and they respond to completely different interventions — which is why "turn sampling down" fixes some of them and none of the others.

BucketWhat it isPaid on
1. Agent/SDK CPU + RSSSpan construction, attribute allocation, batch serialisation, gzip — inside every one of your app processes. A BatchSpanProcessor queue is resident memory in your service, not in observability's budget.100% of spans — unless you head-sample (see Head-Based Sampling), which is the only mechanism that stops a span from being built at all
2. Network egressApp → local collector (free, loopback) → gateway collector (often cross-AZ) → backend (often cross-region or public internet).Whatever survives the agent tier
3. Backend ingestThe billed unit for essentially every SaaS vendor: per GB ingested, or per million spans.Whatever survives tail sampling (see Tail-Based Sampling)
4. Storage + indexBytes on disk × retention days, plus the index write amplification of the Trace Storage part.Ingest × retention — the multiplier

Per-Span vs Per-GB Pricing Changes How Your Engineers Instrument

This is the bucket-3 detail nobody reads the contract for. Two vendors quote what looks like the same product:

Priced per million spans
Adding customer.tier, cart.item_count and feature_flags to every span costs exactly nothing. The rational engineer maximises attributes per span and minimises span count — fewer, fatter spans. Your traces get richer and your span graph gets coarser, which quietly degrades the Reading a Trace part's ability to localise latency.

Priced per GB ingested
Every attribute is money. The rational engineer strips attributes, and the first casualty is the high-value, high-byte ones: db.query.text, exception stack traces, request IDs. Your span count stays honest but your traces stop answering "why" — you can see which span was slow, not what it was doing.

Neither incentive is aligned with debuggability. Know which one you are under before you write the instrumentation guidance in the Instrumentation part, because the pricing model will shape the codebase whether or not you intended it to.

The Move That Breaks the Trade-Off: Span Metrics

The framing "measure everything or afford it" is false, and the thing that makes it false is a single OTel Collector component. The span_metrics connector (in opentelemetry-collector-contrib; the old type name spanmetrics still works but is deprecated) is a connector, not a processor — it terminates a traces pipeline and originates a metrics pipeline. It consumes spans and emits:

callsSum — request + error count
durationHistogram, explicit or exponential
Default dimsservice.name, span.name, span.kind, status.code
Flushmetrics_flush_interval, default 60s

The whole trick is where you put it in the pipeline. Fan the receiver's output into two exporters: the connector, and the tail sampler. The connector sees 100% of spans; the sampler sees 100% and keeps 1%.

connectors:
  span_metrics:
    histogram:
      explicit:
        buckets: [2ms, 10ms, 50ms, 100ms, 400ms, 1s, 5s, 15s]
    dimensions:
      - name: http.request.method
      - name: http.response.status_code
    metrics_flush_interval: 15s
    aggregation_cardinality_limit: 10000   # circuit breaker, 0 = unlimited

service:
  pipelines:
    traces/measure:                  # 100% of spans, never sampled
      receivers:  [otlp]
      processors: [filter]           # health checks dropped, nothing else
      exporters:  [span_metrics]
    traces/store:                    # the expensive path
      receivers:  [otlp]
      processors: [filter, tail_sampling, batch]
      exporters:  [otlp/backend]
    metrics/red:
      receivers:  [span_metrics]
      exporters:  [prometheusremotewrite]

Sample what you store. Never sample what you measure. Your p99 latency, error rate and throughput are computed from all 400,000 spans/s and are statistically exact. Your trace search is a 1% sample and is only ever used for investigation, after a metric told you where to look. Sampling error stops being a correctness problem the moment no alert depends on it.

This is not a clever hack — it is how Jaeger's own Service Performance Monitoring (the Monitor tab) works. Jaeger points its query service at a PromQL-compatible backend (metric_backends.<name>.prometheus.endpoint, referenced from jaeger_query.metrics_storage) and reads the calls_total and duration_milliseconds series the connector produced.

The fork that makes it work — the metrics branch splits off upstream of the sampler
The fork that makes it work — the metrics branch splits off upstream of the sampler

The Cheap Wins, Ranked

  1. Drop health-check, readiness and metrics-scrape spans. Typically 10–40% of span volume, near-zero debugging value. A Kubernetes pod with a 5-second liveness probe and a 10-second Prometheus scrape generates ~26,000 server spans/day per replica that nobody will ever open. Use the filter processor (syntax as of contrib v0.146.0; the older traces: span: form still works):

    processors:
      filter:
        error_mode: ignore
        trace_conditions:
          - span.attributes["url.path"] == "/healthz"
          - span.attributes["url.path"] == "/readyz"
          - span.attributes["url.path"] == "/metrics"

    Its documented warning matters: dropping a span that has children orphans them (see The Trace). Probe spans are leaves, so this case is safe — filtering an intermediate span is not.

  2. Truncate the byte monsters. 20–50% of remaining bytes, ~0% of value. A full db.query.text on a generated ORM query is routinely 4–20 KB — one such attribute outweighs thirty ordinary spans. Same for request/response bodies and for stack traces attached to non-error spans. Truncate at 512–2048 bytes in the collector (transform processor) rather than in every SDK, so the policy is one config change and not 23 deploys.

  3. Differentiate retention by why the trace was kept. 50–70% of storage. See below.

  4. Tier storage. Recent blocks on SSD, everything past ~24–48h on object storage (see Trace Storage). This is where Tempo's design wins outright and Elasticsearch's loses outright.

Retention Tiering Falls Out of the Sampling Policy

The access pattern (see Trace Storage) is extreme: the overwhelming majority of stored traces are never read by anyone, ever. A uniform 30-day retention therefore pays 30 days of storage for data whose read probability is approximately zero. But the tail sampler already told you why each trace survived — the tail_sampling policy name is available as a routing key — so retention differentiates for free:

Kept becauseRetentionRationale
Status = ERROR, or latency > threshold30 daysThe only traces with a real read probability. Also the ones a postmortem needs weeks later.
Probabilistic baseline sample7 daysExists to answer "what does normal look like" — normal from three weeks ago is not a question anyone asks.
Anything a metric already summarises0 daysDon't store it. The histogram is exact and 10,000× smaller.

The Levers, and When Each One Is Wrong

LeverReducesCosts youWhen it's the wrong move
Head sampling at 1% (see Head-Based Sampling)All four buckets, including SDK CPUStructurally drops the rare failures you were hunting — the Central Question's exact woundAny time you need error or outlier traces. Which is every time.
Tail sampling at 1% (see Tail-Based Sampling)Buckets 3 and 4 onlyGateway RAM for the decision buffer; trace-ID-consistent routing constraintsWhen span volume per host already saturates the SDK — tail sampling does nothing for bucket 1.
Span metrics + heavy sampling3 and 4, with no loss of measurement fidelityMetrics cardinality, a second storage system to operateWhen your dimensions are unbounded. Then you've made it worse.
Filter health checks2, 3, 4 — and 1 if done in-processAlmost nothing. Do this first.Only if the probe span is a parent of something real.
Attribute truncation2, 3, 4 (bytes, not span count)The exact field you wanted during the one incident that needed itUnder per-span (not per-GB) pricing, this buys you nothing at all.
Shorter retention4 onlyQuarter-boundary and seasonal comparisons; slow-burn regressionsWhen your incidents are discovered days late — retention shorter than your detection latency is retention of nothing.
Object-storage backend4, by roughly an order of magnitudeSeconds-to-minutes search latency instead of sub-second (see Trace Storage)When an on-call engineer runs dozens of ad-hoc searches per incident.
THE FUNNEL — running example, per second

  app processes          400,000 spans/s   ← bucket 1 paid here, always
        |                   24 TB/day uncompressed
        |  filter: health/ready/metrics (-25%)
        v
  agent collectors       300,000 spans/s
        |                                   ┌──────────────────────────────┐
        +---------------------------------->│ span_metrics connector       │
        |                100% of spans      │ 100% — RED metrics, exact    │
        |                                   │ ~10,000 series, a few MB/day  │
        |  gzip, ~5:1                       └──────────────────────────────┘
        v                                                 |
  gateway collectors      ~3.6 TB/day on the wire         v
        |                 (~$1.4k/mo cross-AZ)     dashboards + alerts
        |  tail_sampling: errors + slow + 1% baseline
        v
  backend ingest            ~4,500 spans/s   (1.5%)
        |                    ~272 GB/day uncompressed
        |  columnar compression ~10:1
        v
  storage                   ~27 GB/day  ×  tiered retention
                            ─────────────────────────────────
                            error + slow  30d →  ~270 GB
                            baseline      7d  →  ~126 GB
                            ~400 GB resident, from 24 TB/day of measurement
  • Guarantees: Metrics derived by the span_metrics connector upstream of the sampler are computed over 100% of the spans that reach that collector — rate, error rate and duration quantiles carry no sampling error, regardless of how aggressively traces are discarded downstream.
  • Does not guarantee: That reducing retained traces reduces your bill proportionally. Buckets 1 and 2 are paid before any sampler runs, and a span_metrics dimension with unbounded cardinality can cost more in the TSDB than the traces it replaced cost in the trace store.