Skip to content

Commit

Permalink
otel 0.25 (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
cottinisimone authored Sep 27, 2024
1 parent fe9cb8e commit 28a0379
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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 = []

Expand Down Expand Up @@ -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"
Expand Down
14 changes: 14 additions & 0 deletions src/request/otel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

0 comments on commit 28a0379

Please sign in to comment.