diff --git a/opentelemetry-sdk/src/logs/log_processor_with_async_runtime.rs b/opentelemetry-sdk/src/logs/log_processor_with_async_runtime.rs index e5649d886b..438312fd56 100644 --- a/opentelemetry-sdk/src/logs/log_processor_with_async_runtime.rs +++ b/opentelemetry-sdk/src/logs/log_processor_with_async_runtime.rs @@ -188,7 +188,12 @@ impl BatchLogProcessor { ) .await; - exporter.shutdown(); + if let Err(shutdown_error) = exporter.shutdown() { + otel_debug!( + name: "BatchLogProcessor.Shutdown.Error", + error = format!("{}", shutdown_error), + ); + } if let Err(send_error) = ch.send(result) { otel_debug!( @@ -282,7 +287,7 @@ where #[cfg(all(test, feature = "testing", feature = "logs"))] mod tests { - use crate::export::logs::{LogBatch, LogExporter}; + use crate::export::logs::{LogBatch, LogExporter, ShutdownResult}; use crate::logs::log_processor::{ OTEL_BLRP_EXPORT_TIMEOUT, OTEL_BLRP_MAX_EXPORT_BATCH_SIZE, OTEL_BLRP_MAX_QUEUE_SIZE, OTEL_BLRP_SCHEDULE_DELAY, @@ -325,7 +330,9 @@ mod tests { async { Ok(()) } } - fn shutdown(&mut self) {} + fn shutdown(&mut self) -> ShutdownResult { + Ok(()) + } fn set_resource(&mut self, resource: &Resource) { self.resource diff --git a/opentelemetry-sdk/src/trace/span_processor_with_async_runtime.rs b/opentelemetry-sdk/src/trace/span_processor_with_async_runtime.rs index c3c241c776..276a33f89f 100644 --- a/opentelemetry-sdk/src/trace/span_processor_with_async_runtime.rs +++ b/opentelemetry-sdk/src/trace/span_processor_with_async_runtime.rs @@ -287,7 +287,12 @@ impl BatchSpanProcessorInternal { // Stream has terminated or processor is shutdown, return to finish execution. BatchMessage::Shutdown(ch) => { self.flush(Some(ch)).await; - self.exporter.shutdown(); + if let Err(shutdown_error) = self.exporter.shutdown() { + otel_debug!( + name: "BatchSpanProcessor.ShutdownError", + msg = format!("{:?}", shutdown_error) + ); + } return false; } // propagate the resource