opentelemetry-rust
opentelemetry-rust copied to clipboard
propagate trace processor errors to users instead of internal logging
Remove internal logging of errors in span processors and tracer provider in favor of returning errors to callers and providing an error handler callback mechanism for background operations.
Changes
- Add error_handler callback to BatchSpanProcessor for background errors (span drops, export failures during timer-based flushes)
- Return errors from shutdown_with_timeout when spans were dropped
- Remove otel_debug/otel_warn/otel_error calls from span processors
- Simplify export error handling by propagating instead of logging
- Update BatchSpanProcessor builder with with_error_handler() method
- Change dropped_spans_count to Arc<AtomicUsize> for shared ownership
- Remove shutdown error logging from TracerProviderInner
This gives users explicit control over error handling rather than relying on internal SDK logging that may be missed or not actionable.
Fixes #3210
Merge requirement checklist
- [x] CONTRIBUTING guidelines followed
- [x] Unit tests added/updated (if applicable)
- [ ] Appropriate
CHANGELOG.mdfiles updated for non-trivial, user-facing changes - [ ] Changes in public API reviewed (if applicable)