Research · December 2026

Tail sampling made our error rate read 9× high

Same spans, two error rates. A real OpenTelemetry Collector run shows what happens when an SLI is computed after a tail sampler, and the cheap fix.

By Stephen Ternes · Open data and config on GitHub

1.2%true error rate, computed from all 39,818 spans
11.1%the same error rate, computed after the tail sampler (9.3×)
16 / 16minutes over a 2% alert threshold on sampled data, versus 3 real ones
3.0×p99 latency inflation: 628 ms became 1,900 ms

If your error-rate or latency SLI is computed from traces after a tail sampler that keeps errors and slow requests, it grades a biased sample. The dashboard still looks plausible, which is exactly why nobody notices.

I wanted a number rather than an argument, so I ran it on a real collector.

Same spans, two error rates Metrics computed after tail sampling read ~9× high: all 16 minutes over the alert threshold, versus 3 real ones. incident (3% errors) 0%5%10%15%20%25%03691215 Minute of the run 2% alert threshold Minute 0: 9.26%Minute 1: 3.66%Minute 2: 4.25%Minute 3: 4.71%Minute 4: 5.26%Minute 5: 5.17%Minute 6: 21.07%Minute 7: 22.40%Minute 8: 23.12%Minute 9: 15.41%Minute 10: 8.51%Minute 11: 3.83%Minute 12: 3.74%Minute 13: 4.42%Minute 14: 2.70%Minute 15: 7.41% Minute 0: 0.76%Minute 1: 0.34%Minute 2: 0.45%Minute 3: 0.28%Minute 4: 0.51%Minute 5: 0.45%Minute 6: 2.98%Minute 7: 2.85%Minute 8: 3.03%Minute 9: 0.95%Minute 10: 0.84%Minute 11: 0.39%Minute 12: 0.34%Minute 13: 0.51%Minute 14: 0.17%Minute 15: 0.51% After sampler(dashboard) Before sampler(the truth) Stephen Ternes · AspectIQ · real otelcol-contrib 0.115.0 run, 39,818 spans · policy: keep errors, keep >1 s, 10% of the rest

The setup

Collector: otelcol-contrib 0.115.0. One pipeline sends every span to the spanmetrics connector: that’s the truth. A second pipeline runs tail_sampling first and then a second spanmetrics copy. That second copy is the anti-pattern, built in on purpose for comparison.

Tail-sampling policy, a common one: keep all errors, keep anything slower than 1 s, keep 10% of everything else.

Load: the Python OpenTelemetry SDK 1.28.2 sent about 40 requests per second for 15 minutes at 0.5% errors. During an incident in minutes 6 to 9, errors went to 3% and traffic to 1.6×. Prometheus 2.55.1 and Alertmanager 0.27.0 scraped and alerted; the rules passed promtool test rules.

What it showed

The collector refused 0 spans and the tail sampler decided 39,837 traces, keeping 4,310 (10.8%). Nothing was lost in transit. The distortion comes entirely from where the metric is computed.

  • Error rate across the whole run: 1.19% before the sampler, 11.09% after.
  • During the incident: 2.85–3.03% true, 21.1–23.1% after the sampler.
  • In normal minutes: 0.17–0.95% true, 2.7–15.4% after the sampler. Every normal minute would have breached a 2% threshold.
  • p99 latency: 628 ms true, 1,900 ms after the sampler.

Why it happens

The policy keeps 100% of errors and slow requests but only 10% of healthy, fast ones. Any ratio computed on the kept set over-weights exactly the things an SLI is meant to measure.

Fixes, in order of preference

1. Compute RED metrics before the sampler

Run the spanmetrics connector on a pipeline that sees 100% of spans, and sample only what you store:

service:
  pipelines:
    traces/all:        # every span feeds the metrics, never sampled
      receivers: [otlp]
      exporters: [spanmetrics]
    traces/sampled:    # same spans, sampled for storage
      receivers: [otlp]
      processors: [tail_sampling, batch]
      exporters: [otlp/traces-backend]
    metrics/red:
      receivers: [spanmetrics]
      exporters: [prometheus]

2. If you must use sampled data, weight it

Each span kept only by the 10% rule stands for 10 requests. In a seeded simulation that accompanies this run, weighted counts gave 1.17% against a true 1.15%.

3. Test the alert path, not just the rule

A rule unit test passes on either number. Only a check against known input shows which number your alert actually reads.

A second finding I didn’t plan for

The correct rule (true metrics, rate(...[5m]), for: 2m, 2% threshold) fired once, at about minute 11: after the three-minute incident had already ended. A long rate window averages short incidents away, and for: delays what’s left. That’s the case for multi-window, multi-burn-rate SLO alerts, as described in the Google SRE Workbook’s chapter on alerting on SLOs.

Limits. This is one synthetic service and one 16-minute run with a single, common sampling policy. Your factor depends on your error rate, latency mix and policy; the direction of the bias doesn’t. Treat the numbers as an illustration of the mechanism, not a benchmark.

Reproduce it

Know before you cut over.

Thirty minutes. Your stack, your date, your critical alerts.

Book a Cutover Readiness Call