- A Simple Span Processor: exports each span immediately when it ends (good for debugging/development but higher overhead)
- A Batch Span Processor: buffers spans and sends them in batches (better for production/performance)
| BatchSpanProcessor | SimpleSpanProcessor | |
|---|---|---|
| Best For | Production & staging environments | Local debugging, demos, CI tests |
| Export Behavior | Exports spans asynchronously in batches | Exports each span immediately (sync) |
| Impact on Latency | Low latency – work done off the request path | Higher latency – export blocks the request |
| Throughput | High throughput, optimized for volume | Low throughput, can bottleneck under load |
| Resource Usage | Uses memory for queue & background thread | Minimal memory overhead |
| Reliability on Exit | Requires force_flush() / shutdown() to avoid span loss | Spans exported immediately, low chance of loss |
| Visibility Speed | Slight delay (buffering) before spans visible | Immediate – spans appear as soon as they end |
| Failure Surfacing | Export failures logged in background | Failures raised inline (easy to notice) |
| Tuning Options | Highly configurable (batch size, delay, timeouts) | Minimal configuration |