Blog
Trace Sampling: Keep The Weird Requests, Not Just One Percent
Keeping a random 1% of traces controls cost. It also gives a rare production failure a 99% chance of disappearing.
Head Sampling Is Cheap And Blind
Head sampling decides near request start. It is fast, consistent when the decision propagates, and cannot know whether the request will later fail or take eight seconds.
Use it for broad baseline coverage. Make sure downstream services honor the same decision; independent coin flips create broken traces and confusing volume.
Tail Sampling Sees The Outcome
Tail sampling buffers spans and decides after completion. It can retain errors, slow requests, unusual routes, or selected tenants while sampling ordinary success aggressively.
The price is more memory, latency, and collector complexity. A collector failure can also discard the very evidence you wanted.
Build A Portfolio
Keep all critical errors, a high share of latency outliers, and a small random baseline. Add explicit rules for low-volume, high-value operations. Apply rate limits so an error storm does not become an observability outage.
Record the sampling policy and effective rate with the trace. Otherwise analysts may treat a biased sample as representative traffic.
Sampling is not merely a percentage knob. It is a decision about which unknown incidents will remain debuggable.