From 540c6f17fca8fdb6f412bb0bcd26c7599bd05f5e Mon Sep 17 00:00:00 2001 From: Cijo Thomas Date: Thu, 7 Nov 2024 12:05:28 -0800 Subject: [PATCH] Few fixes to changelog for breaking changes (#2287) --- opentelemetry-otlp/CHANGELOG.md | 34 ++++++++++++++++++--------------- opentelemetry-sdk/CHANGELOG.md | 2 +- opentelemetry/CHANGELOG.md | 14 ++++++-------- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/opentelemetry-otlp/CHANGELOG.md b/opentelemetry-otlp/CHANGELOG.md index 02d6b145cc..a02bc05504 100644 --- a/opentelemetry-otlp/CHANGELOG.md +++ b/opentelemetry-otlp/CHANGELOG.md @@ -2,14 +2,6 @@ ## vNext -## v0.26.0 -Released 2024-Sep-30 - -- Update `opentelemetry` dependency version to 0.26 -- Update `opentelemetry_sdk` dependency version to 0.26 -- Update `opentelemetry-http` dependency version to 0.26 -- Update `opentelemetry-proto` dependency version to 0.26 -- Bump MSRV to 1.71.1 [2140](https://github.com/open-telemetry/opentelemetry-rust/pull/2140) - **BREAKING**: - ([#2217](https://github.com/open-telemetry/opentelemetry-rust/pull/2217)) **Replaced**: The `MetricsExporterBuilder` interface is modified from `with_temporality_selector` to `with_temporality` example can be seen below: Previous Signature: @@ -31,6 +23,7 @@ Released 2024-Sep-30 ```rust let logger_provider: LoggerProvider = opentelemetry_otlp::new_pipeline() .logging() + .with_resource(RESOURCE.clone()) .with_exporter( opentelemetry_otlp::new_exporter() .tonic() @@ -40,13 +33,15 @@ Released 2024-Sep-30 ``` Updated Signature: ```rust - let logger_provider: LoggerProvider = LoggerProvider::builder() - .install_batch_exporter( - LogExporter::builder() - .with_tonic() - .with_endpoint("http://localhost:4317") - .build()?, - ).build(); + let exporter = LogExporter::builder() + .with_tonic() + .with_endpoint("http://localhost:4317") + .build()?; + + Ok(LoggerProvider::builder() + .with_resource(RESOURCE.clone()) + .with_batch_exporter(exporter, runtime::Tokio) + .build()) ``` - **Renamed** - ([#2255](https://github.com/open-telemetry/opentelemetry-rust/pull/2255)): de-pluralize Metric types. @@ -56,6 +51,15 @@ Released 2024-Sep-30 - [#2263](https://github.com/open-telemetry/opentelemetry-rust/pull/2263) Support `hyper` client for opentelemetry-otlp. This can be enabled using flag `hyper-client`. Refer example: https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-otlp/examples/basic-otlp-http + +## v0.26.0 +Released 2024-Sep-30 + +- Update `opentelemetry` dependency version to 0.26 +- Update `opentelemetry_sdk` dependency version to 0.26 +- Update `opentelemetry-http` dependency version to 0.26 +- Update `opentelemetry-proto` dependency version to 0.26 +- Bump MSRV to 1.71.1 [2140](https://github.com/open-telemetry/opentelemetry-rust/pull/2140) ## v0.25.0 diff --git a/opentelemetry-sdk/CHANGELOG.md b/opentelemetry-sdk/CHANGELOG.md index 812fe80672..af0e6e64cb 100644 --- a/opentelemetry-sdk/CHANGELOG.md +++ b/opentelemetry-sdk/CHANGELOG.md @@ -5,7 +5,7 @@ - Bump MSRV to 1.70 [#2179](https://github.com/open-telemetry/opentelemetry-rust/pull/2179) - Implement `LogRecord::set_trace_context` for `LogRecord`. Respect any trace context set on a `LogRecord` when emitting through a `Logger`. - Improved `LoggerProvider` shutdown handling to prevent redundant shutdown calls when `drop` is invoked. [#2195](https://github.com/open-telemetry/opentelemetry-rust/pull/2195) -- When creating new metric instruments, SDK would return a no-op instrument if the validation fails. [#2166](https://github.com/open-telemetry/opentelemetry-rust/pull/2166) +- When creating new metric instruments by calling `build()`, SDK would return a no-op instrument if the validation fails (eg: Invalid metric name). [#2166](https://github.com/open-telemetry/opentelemetry-rust/pull/2166) - **BREAKING for Metrics users**: - **Replaced** - ([#2217](https://github.com/open-telemetry/opentelemetry-rust/pull/2217)): Removed `{Delta,Cumulative}TemporalitySelector::new()` in favor of directly using `Temporality` enum to simplify the configuration of MetricsExporterBuilder with different temporalities. diff --git a/opentelemetry/CHANGELOG.md b/opentelemetry/CHANGELOG.md index 878a10d80f..e6adb7a5d4 100644 --- a/opentelemetry/CHANGELOG.md +++ b/opentelemetry/CHANGELOG.md @@ -8,11 +8,9 @@ - Introduced `SyncInstrument` trait to replace the individual synchronous instrument traits (`SyncCounter`, `SyncGauge`, `SyncHistogram`, `SyncUpDownCounter`) which are meant for SDK implementation. [#2207](https://github.com/open-telemetry/opentelemetry-rust/pull/2207) - Ensured that `observe` method on asynchronous instruments can only be called inside a callback. This was done by removing the implementation of `AsyncInstrument` trait for each of the asynchronous instruments. [#2210](https://github.com/open-telemetry/opentelemetry-rust/pull/2210) - Removed `PartialOrd` and `Ord` implementations for `KeyValue`. [#2215](https://github.com/open-telemetry/opentelemetry-rust/pull/2215) -- **Breaking change** Removed `try_init` methods from the instrument builders. Users should only use `init` method to create instruments. [#2227](https://github.com/open-telemetry/opentelemetry-rust/pull/2227) -- Updated the return types of `InstrumentProvider` trait methods to return the instrument instead of a `Result`. [#2227](https://github.com/open-telemetry/opentelemetry-rust/pull/2227) - **Breaking change for exporter authors:** Marked `KeyValue` related structs and enums as `non_exhaustive`. [#2228](https://github.com/open-telemetry/opentelemetry-rust/pull/2228) - **Breaking change for log exporter authors:** Marked `AnyValue` enum as `non_exhaustive`. [#2230](https://github.com/open-telemetry/opentelemetry-rust/pull/2230) -- **Breaking change for Metrics users:** The `init` method used to create instruments has been renamed to `build`. +- **Breaking change for Metrics users:** The `init` method used to create instruments has been renamed to `build`. Also, `try_init()` method is removed from instrument builders. The return types of `InstrumentProvider` trait methods modified to return the instrument struct, instead of `Result`. [#2227](https://github.com/open-telemetry/opentelemetry-rust/pull/2227) Before: ```rust @@ -32,16 +30,16 @@ let counter = meter.u64_counter("my_counter").build(); - Replaced these methods with `LoggerProvider::logger_with_scope`, `TracerProvider::logger_with_scope`, `MeterProvider::meter_with_scope` - Replaced `global::meter_with_version` with `global::meter_with_scope` - Added `global::tracer_with_scope` + - Refer to PR description for migration guide. +- **Breaking change**: replaced `InstrumentationScope` public attributes by getters [#2275](https://github.com/open-telemetry/opentelemetry-rust/pull/2275) - **Breaking change**: [#2260](https://github.com/open-telemetry/opentelemetry-rust/pull/2260) - Removed `global::set_error_handler` and `global::handle_error`. - `global::handle_error` usage inside the opentelemetry crates has been replaced with `global::otel_info`, `otel_warn`, `otel_debug` and `otel_error` macros based on the severity of the internal logs. - - The default behavior of `global::handle_error` was to log the error using `eprintln!`. With otel macro, the internal logs get emitted via `tracing` macros of matching severity. Users now need to configure the `tracing` layer to capture these logs. - - Refer to this PR description for migration guide. Also refer to [self-diagnostics](https://github.com/open-telemetry/opentelemetry-rust/tree/main/examples/self-diagnostics) example on how to configure the tracing layer for internal logs. -- **Breaking change**: replaced `InstrumentationScope` public attributes by getters [#2275](https://github.com/open-telemetry/opentelemetry-rust/pull/2275) + - The default behavior of `global::handle_error` was to log the error using `eprintln!`. With otel macros, the internal logs get emitted via `tracing` macros of matching severity. Users now need to configure a `tracing` layer/subscriber to capture these logs. + - Refer to PR description for migration guide. Also refer to [self-diagnostics](https://github.com/open-telemetry/opentelemetry-rust/tree/main/examples/self-diagnostics) example to learn how to view internal logs in stdout using `tracing::fmt` layer. - -- [#2266](https://github.com/open-telemetry/opentelemetry-rust/pull/2266) +- **Breaking change for exporter/processor authors:** [#2266](https://github.com/open-telemetry/opentelemetry-rust/pull/2266) - Moved `ExportError` trait from `opentelemetry::ExportError` to `opentelemetry_sdk::export::ExportError` - Created new trait `opentelemetry::trace::ExportError` for trace API. This would be eventually be consolidated with ExportError in the SDK. - Moved `LogError` enum from `opentelemetry::logs::LogError` to `opentelemetry_sdk::logs::LogError`