diff --git a/CHANGELOG.md b/CHANGELOG.md index 25ed6b7..e6b0088 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,14 @@ and this project adheres to --- +## [0.17.0] - 2024-09-27 + +### Added + +- Support for opentelemetry 0.25, now the default version. + +--- + ## [0.16.6] - 2024-09-05 ### Added @@ -460,7 +468,8 @@ Request::rest(&bridge).send() The old API is still available but deprecated. It will be removed soon. -[Unreleased]: https://github.com/primait/bridge.rs/compare/0.16.6...HEAD +[Unreleased]: https://github.com/primait/bridge.rs/compare/0.17.0...HEAD +[0.17.0]: https://github.com/primait/bridge.rs/compare/0.16.6...0.17.0 [0.16.6]: https://github.com/primait/bridge.rs/compare/0.16.5...0.16.6 [0.16.5]: https://github.com/primait/bridge.rs/compare/0.16.4...0.16.5 [0.16.3]: https://github.com/primait/bridge.rs/compare/0.16.2...0.16.2 diff --git a/Cargo.toml b/Cargo.toml index 0664594..b36bff6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT" name = "prima_bridge" readme = "README.md" repository = "https://github.com/primait/bridge.rs" -version = "0.16.7" +version = "0.17.0" # See https://github.com/rust-lang/rust/issues/107557 rust-version = "1.72" @@ -16,13 +16,14 @@ default = ["tracing_opentelemetry"] auth0 = ["rand", "redis", "jsonwebtoken", "chrono", "chacha20poly1305", "dashmap", "tracing"] gzip = ["reqwest/gzip"] redis-tls = ["redis/tls", "redis/tokio-native-tls-comp"] -tracing_opentelemetry = [ "tracing_opentelemetry_0_24" ] +tracing_opentelemetry = [ "tracing_opentelemetry_0_25" ] tracing_opentelemetry_0_20 = ["_any_otel_version", "tracing", "tracing-opentelemetry_0_21_pkg", "opentelemetry_0_20_pkg"] tracing_opentelemetry_0_21 = ["_any_otel_version", "tracing", "tracing-opentelemetry_0_22_pkg", "opentelemetry_0_21_pkg", "opentelemetry_sdk_0_21_pkg"] tracing_opentelemetry_0_22 = ["_any_otel_version", "tracing", "tracing-opentelemetry_0_23_pkg", "opentelemetry_0_22_pkg", "opentelemetry_sdk_0_22_pkg"] tracing_opentelemetry_0_23 = ["_any_otel_version", "tracing", "tracing-opentelemetry_0_24_pkg", "opentelemetry_0_23_pkg", "opentelemetry_sdk_0_23_pkg"] tracing_opentelemetry_0_24 = ["_any_otel_version", "tracing", "tracing-opentelemetry_0_25_pkg", "opentelemetry_0_24_pkg", "opentelemetry_sdk_0_24_pkg"] +tracing_opentelemetry_0_25 = ["_any_otel_version", "tracing", "tracing-opentelemetry_0_26_pkg", "opentelemetry_0_25_pkg", "opentelemetry_sdk_0_25_pkg"] _any_otel_version = [] @@ -53,15 +54,18 @@ opentelemetry_0_21_pkg = { package = "opentelemetry", version = "0.21", optional opentelemetry_0_22_pkg = { package = "opentelemetry", version = "0.22", optional = true } opentelemetry_0_23_pkg = { package = "opentelemetry", version = "0.23", optional = true } opentelemetry_0_24_pkg = { package = "opentelemetry", version = "0.24", optional = true } +opentelemetry_0_25_pkg = { package = "opentelemetry", version = "0.25", optional = true } opentelemetry_sdk_0_21_pkg = { package = "opentelemetry_sdk", version = "0.21", optional = true } opentelemetry_sdk_0_22_pkg = { package = "opentelemetry_sdk", version = "0.22", optional = true } opentelemetry_sdk_0_23_pkg = { package = "opentelemetry_sdk", version = "0.23", optional = true } opentelemetry_sdk_0_24_pkg = { package = "opentelemetry_sdk", version = "0.24", optional = true } +opentelemetry_sdk_0_25_pkg = { package = "opentelemetry_sdk", version = "0.25", optional = true } tracing-opentelemetry_0_21_pkg = { package = "tracing-opentelemetry", version = "0.21", optional = true } tracing-opentelemetry_0_22_pkg = { package = "tracing-opentelemetry", version = "0.22", optional = true } tracing-opentelemetry_0_23_pkg = { package = "tracing-opentelemetry", version = "0.23", optional = true } tracing-opentelemetry_0_24_pkg = { package = "tracing-opentelemetry", version = "0.24", optional = true } tracing-opentelemetry_0_25_pkg = { package = "tracing-opentelemetry", version = "0.25", optional = true } +tracing-opentelemetry_0_26_pkg = { package = "tracing-opentelemetry", version = "0.26", optional = true } [dev-dependencies] flate2 = "1.0" diff --git a/src/request/otel.rs b/src/request/otel.rs index 4447e80..2b0a1fc 100644 --- a/src/request/otel.rs +++ b/src/request/otel.rs @@ -55,6 +55,17 @@ mod otel_0_24 { } } +#[cfg(feature = "tracing_opentelemetry_0_25")] +mod otel_0_25 { + pub use opentelemetry_0_25_pkg::propagation::{Injector, TextMapPropagator}; + pub use opentelemetry_sdk_0_25_pkg::propagation::TraceContextPropagator; + pub use tracing_opentelemetry_0_26_pkg::OpenTelemetrySpanExt; + + pub fn inject_context(injector: &mut dyn Injector) { + TraceContextPropagator::new().inject_context(&tracing::Span::current().context(), injector); + } +} + #[cfg(feature = "tracing_opentelemetry_0_20")] pub use otel_0_20::inject_context; @@ -69,3 +80,6 @@ pub use otel_0_23::inject_context; #[cfg(feature = "tracing_opentelemetry_0_24")] pub use otel_0_24::inject_context; + +#[cfg(feature = "tracing_opentelemetry_0_25")] +pub use otel_0_25::inject_context;