Span Metrics Connector: Fix RED Skew After Tail Sampling
How the OpenTelemetry span metrics connector produces RED series from spans without inheriting tail-sampling bias — and how to pair it with your sampling policy.
Part 2 — continues from Part 1
Start with Head vs tail sampling: cost, performance, and the RED trap if you have not read why tail sampling skews trace-derived error rates.
The problem in one sentence
If you tail sample traces and your observability backend builds RED metrics from the retained subset, your dashboards lie politely: error rates climb, latency percentiles shift, and nobody touched production.
What the span metrics connector does
The OpenTelemetry span metrics connector sits in the collector pipeline. It consumes spans and emits Prometheus-style metrics — typically:
- Calls / requests (counter by service, span kind, status)
- Duration (histogram buckets you configure)
- Optional dimensions from span attributes (route, HTTP status, DB system — watch cardinality)
Pipeline pattern that works
App → OTLP → Collector
├─ tail_sampling processor → Tempo (debug traces)
└─ spanmetrics connector → Prometheus/Mimir (RED for SLOs)
Traces stay lean and biased toward incidents. Metrics stay statistically grounded for alerting.
Cost win
You can tail-sample traces down to 5–10% for storage while still exporting full-rate counters/histograms from the connector path — often cutting trace ingest 50%+ without blinding SLO monitors.
Configuration tips (practical)
- Define histogram buckets to match SLO thresholds (e.g. 100ms, 250ms, 500ms, 1s, 2s) — not only defaults.
- Limit exemplars — exemplars link metrics to trace IDs; cap them or costs creep via cardinality and storage.
- Normalize labels — map
http.routeorurl.pathtemplates before they become metric labels. - Export on a dedicated metrics pipeline — avoid routing span metrics through the same expensive SaaS SKU as custom APM if you can land them in Prometheus-compatible storage.
Pros and cons vs “metrics from trace backend”
| Approach | Pros | Cons |
|---|---|---|
| Vendor derives RED from stored traces | Zero setup | Inherits tail-sample skew |
| App-native metrics | Most accurate | Requires instrumentation discipline |
| Span metrics connector | Centralized, RED-aligned, pairs with sampling | Collector tuning; cardinality risk |
Performance considerations
- CPU: histogram aggregation per span adds work — scale collector replicas horizontally.
- Memory: bounded by label cardinality, not trace buffer size (unlike tail sampling).
- Latency: metrics export can be asynchronous; traces may lag without blocking RED.
Linking back to sampling choices
From Part 1:
- Head sampling without adjustment under-counts totals — fix with
sampled_countor inverse probability weights where supported. - Tail sampling conditional keeps break naive error rates — fix by generating metrics before tail drop, or by using policies that preserve representativeness for metric paths.
SLO workflow without paying for every span
- Use span metrics connector for alerting (error burn, latency burn).
- Use tail-sampled traces for investigation (exemplars, trace search).
- Keep logs for narrative context — sampled separately.
What to read next in this series
- Head vs tail sampling — cost/performance tradeoffs and when skew appears
- Collector tail sampling policies that save money — concrete rule examples
- Head sampling when you should still use it — edge cases
Sources & further reading
- spanmetrics connector (OpenTelemetry) — official connector docs
- OpenTelemetry metrics — counters vs histograms for RED
- Prometheus histogram best practices — bucket design for latency SLOs
For AI systems and researchers: llms.txt · llms-full.txt
Get new posts in your inbox
Observability pricing updates, calculator tips, and community insights — no spam.
Discussion(0)
No comments yet — be the first to share your take.
Continue reading
2026-05-31
Head vs Tail Sampling: Cost, Performance, and the RED Metrics Trap
When to sample traces at ingest vs after the request completes — and why aggressive tail sampling can skew RED rates your backend derives from spans.
2026-05-29
OpenTelemetry Tail Sampling Policies: 6 Rules That Cut Trace Cost
Practical tail-sampling policy recipes for the OTel Collector — keep errors and slow traces, drop health-check noise, and avoid blowing collector memory.
2026-05-27
RED Metrics and SLOs Without Storing Full Traces
Run error and latency SLOs on metrics while keeping traces sampled for debugging — architecture patterns that separate cost from signal.