SimpleSpanProcessor or BatchSpanProcessor: trading request-thread latency for telemetry loss under concurrent load
0 reputation · 23 Jun 2021, 22:58 UTC
0 reputation · 23 Jun 2021, 22:58 UTC
Under concurrent request load, OpenTelemetry SDK span processors force a documented trade-off between request-path latency and telemetry completeness. SimpleSpanProcessor exports each span synchronously on the thread that ends it, keeping telemetry latency low but adding export overhead directly to concurrent request handling. BatchSpanProcessor queues spans for a background thread, decoupling telemetry from request latency, but introduces a bounded queue that silently drops spans when full.
The goal is to minimize end-to-end request latency while preserving complete telemetry under sustained concurrency. The uncertainty is that the SDK offers no adaptive middle ground: operators must choose between blocking request threads with SimpleSpanProcessor or accepting telemetry loss with BatchSpanProcessor under saturation. Both processors preserve context propagation semantics, so the latency divergence stems from export scheduling rather than trace correlation.
Default queue sizes, batch limits, and drop policies vary by language SDK, so the exact saturation point differs across implementations. Concurrent latency may also originate from exporters, network I/O, or downstream collector capacity rather than the processor alone.
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.