diff --git a/opentelemetry-sdk/CHANGELOG.md b/opentelemetry-sdk/CHANGELOG.md index 6209c7331d..4807051753 100644 --- a/opentelemetry-sdk/CHANGELOG.md +++ b/opentelemetry-sdk/CHANGELOG.md @@ -28,6 +28,9 @@ - After `shutdown`, `LogProcessor` will not process any new logs - Moving LogRecord implementation to the SDK. [1702](https://github.com/open-telemetry/opentelemetry-rust/pull/1702). - Relocated `LogRecord` struct to SDK, as an implementation for the trait in the API. +- **Breaking** [#1729](https://github.com/open-telemetry/opentelemetry-rust/pull/1729) + - Update the return type of `TracerProvider.span_processors()` from `&Vec>` to `&[Box]`. + - Update the return type of `LoggerProvider.log_processors()` from `&Vec>` to `&[Box]`. ## v0.22.1 diff --git a/opentelemetry-sdk/src/logs/log_emitter.rs b/opentelemetry-sdk/src/logs/log_emitter.rs index 59d9d9e3d5..bf1d045a9f 100644 --- a/opentelemetry-sdk/src/logs/log_emitter.rs +++ b/opentelemetry-sdk/src/logs/log_emitter.rs @@ -91,7 +91,7 @@ impl LoggerProvider { } /// Log processors associated with this provider. - pub fn log_processors(&self) -> &Vec> { + pub fn log_processors(&self) -> &[Box] { &self.inner.processors } diff --git a/opentelemetry-sdk/src/trace/provider.rs b/opentelemetry-sdk/src/trace/provider.rs index c42ebc03b0..1fbe22d628 100644 --- a/opentelemetry-sdk/src/trace/provider.rs +++ b/opentelemetry-sdk/src/trace/provider.rs @@ -62,7 +62,7 @@ impl TracerProvider { } /// Span processors associated with this provider - pub fn span_processors(&self) -> &Vec> { + pub fn span_processors(&self) -> &[Box] { &self.inner.processors } diff --git a/opentelemetry-sdk/src/trace/span.rs b/opentelemetry-sdk/src/trace/span.rs index 5f6fcba49c..2ff3079cda 100644 --- a/opentelemetry-sdk/src/trace/span.rs +++ b/opentelemetry-sdk/src/trace/span.rs @@ -219,7 +219,7 @@ impl Span { data.end_time = opentelemetry::time::now(); } - match provider.span_processors().as_slice() { + match provider.span_processors() { [] => {} [processor] => { processor.on_end(build_export_data(