Skip to content
Latchkey

What Is Head-Based Sampling?

Head-based sampling makes the keep-or-drop decision when a trace begins, typically by a probability applied to the root span, and propagates that decision to all child spans. It needs no buffering because the verdict is fixed up front. The cost is that it cannot favor slow or failed traces, since their outcome is not yet known.

Why it matters

Head-based sampling is simple and low-overhead, which makes it the common default. But because it is blind to outcomes, it may discard the very traces an investigation needs.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →