A tail sampler receives 3,000 new traces a second, waits 30 seconds before deciding, and traces average 15 spans of about 500 bytes. How much must it hold, and what breaks if the buffer is too small?
Sketch your own answer first, then compare it with the one below.
A strong answer
Multiply rate by wait. 3,000 traces a second for 30 seconds is 90,000 traces in flight. At 15 spans each that is 1.35 million spans, and at 500 bytes each about 675 MB. Real in-memory representations are larger than the encoded size, so plan for a multiple of that, and for bursts on top of it. If the work is spread across several sampler instances by trace ID, divide by the instance count.
If the buffer holds fewer traces than the rate times the wait, it has to push traces out before their timer fires. Those are judged early on partial data or lost, and the configured wait no longer means what it says. A slow trace is the likeliest casualty, because it is the one still open when its turn comes.
Two related issues belong in the same sizing exercise. Spans can arrive after a decision, so keep a cache of recent decisions to let late spans follow the earlier verdict. And all spans of a trace must go to the same instance, so route by trace ID, and expect a resize to split the traces in flight.
Sources
- OpenTelemetry Collector contributors (2025). Tail sampling processor.
- OpenTelemetry project (2024). Sampling.