Skip to content

Commit ffdb86d

Browse files
committed
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.
1 parent 3b2f751 commit ffdb86d

File tree

3 files changed

+208
-160
lines changed

3 files changed

+208
-160
lines changed

opentelemetry-sdk/src/trace/provider.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,6 @@ impl TracerProviderInner {
116116
let mut results = vec![];
117117
for processor in &self.processors {
118118
let result = processor.shutdown_with_timeout(timeout);
119-
if let Err(err) = &result {
120-
// Log at debug level because:
121-
// - The error is also returned to the user for handling (if applicable)
122-
// - Or the error occurs during `TracerProviderInner::Drop` as part of telemetry shutdown,
123-
// which is non-actionable by the user
124-
otel_debug!(name: "TracerProvider.Drop.ShutdownError",
125-
error = format!("{err}"));
126-
}
127119
results.push(result);
128120
}
129121
results

0 commit comments

Comments
 (0)