Skip to content

Commit 8fb6ecf

Browse files
add default implementation for shutdown_with_timeout in logexporter trait
1 parent 45cfe3f commit 8fb6ecf

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

opentelemetry-sdk/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ also modified to suppress telemetry before invoking exporters.
2525
- Fixed the overflow attribute to correctly use the boolean value `true`
2626
instead of the string `"true"`.
2727
[#2878](https://github.com/open-telemetry/opentelemetry-rust/issues/2878)
28-
- *Breaking* The `shutdown_with_timeout` method is added to LogExporter trait. This is breaking change for custom `LogExporter` authors.
28+
- The `shutdown_with_timeout` method is added to LogExporter trait.
2929
- *Breaking* `MetricError`, `MetricResult` no longer public (except when
3030
`spec_unstable_metrics_views` feature flag is enabled). `OTelSdkResult` should
3131
be used instead, wherever applicable. [#2906](https://github.com/open-telemetry/opentelemetry-rust/pull/2906)

opentelemetry-sdk/src/logs/export.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ pub trait LogExporter: Send + Sync + Debug {
136136
batch: LogBatch<'_>,
137137
) -> impl std::future::Future<Output = OTelSdkResult> + Send;
138138
/// Shuts down the exporter.
139-
fn shutdown_with_timeout(&self, _timeout: time::Duration) -> OTelSdkResult;
139+
fn shutdown_with_timeout(&self, _timeout: time::Duration) -> OTelSdkResult {
140+
Ok(())
141+
}
140142
/// Shuts down the exporter with a default timeout.
141143
fn shutdown(&self) -> OTelSdkResult {
142144
self.shutdown_with_timeout(time::Duration::from_secs(5))

opentelemetry-sdk/src/logs/in_memory_exporter.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,6 @@ impl LogExporter for InMemoryLogExporter {
215215
Ok(())
216216
}
217217

218-
fn shutdown(&self) -> OTelSdkResult {
219-
self.shutdown_with_timeout(time::Duration::from_secs(5))
220-
}
221-
222218
fn set_resource(&mut self, resource: &Resource) {
223219
let mut res_guard = self.resource.lock().expect("Resource lock poisoned");
224220
*res_guard = resource.clone();

0 commit comments

Comments
 (0)