From 9745521e4d8a1785a13b72210f4c2d0640c02a06 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Thu, 27 Jun 2024 13:16:58 -0700 Subject: [PATCH] leftover --- opentelemetry-sdk/src/export/logs/mod.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/opentelemetry-sdk/src/export/logs/mod.rs b/opentelemetry-sdk/src/export/logs/mod.rs index 0ce5929704..b2e8d9164e 100644 --- a/opentelemetry-sdk/src/export/logs/mod.rs +++ b/opentelemetry-sdk/src/export/logs/mod.rs @@ -27,7 +27,17 @@ pub trait LogExporter: Send + Sync + Debug { /// Any retry logic that is required by the exporter is the responsibility /// of the exporter. async fn export<'a>(&mut self, batch: Vec>) -> LogResult<()>; - /// Shuts down the exporter. + /// Shuts down the exporter. Called when SDK is shut down. This is an + /// opportunity for exporter to do any cleanup required. + /// + /// This function should be called only once for each `LogExporter` + /// instance. After the call to `shutdown`, subsequent calls to `export` are + /// not allowed and should return an error. + /// + /// This function should not block indefinitely (e.g. if it attempts to + /// flush the data and the destination is unavailable). SDK authors + /// can decide if they want to make the shutdown timeout + /// configurable. fn shutdown(&mut self) {} #[cfg(feature = "logs_level_enabled")] /// Chek if logs are enabled.