Skip to content

Conversation

@svencowart
Copy link

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 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

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@svencowart svencowart requested a review from a team as a code owner October 24, 2025 22:50
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 24, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: svencowart / name: Sven Cowart (620043d)

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.
@svencowart svencowart force-pushed the propogate-trace-errors branch from ffdb86d to 620043d Compare October 24, 2025 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Library crates should propagate errors instead of silently logging them

1 participant