diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8af77ad..12ffefd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: - opentelemetry_0_15 - opentelemetry_0_16 - opentelemetry_0_17 + - opentelemetry_0_18 steps: - name: Checkout repository uses: actions/checkout@v2 @@ -61,6 +62,7 @@ jobs: - opentelemetry_0_15 - opentelemetry_0_16 - opentelemetry_0_17 + - opentelemetry_0_18 steps: - name: Checkout repository uses: actions/checkout@v2 @@ -88,6 +90,7 @@ jobs: - opentelemetry_0_15 - opentelemetry_0_16 - opentelemetry_0_17 + - opentelemetry_0_18 steps: - name: Checkout repository uses: actions/checkout@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index bce41c7..e1d410e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Implementation of `Debug` trait for `RequestBuilder`. +- Added support for `opentelemetry` version `0.18`. ## [0.1.5] - 2022-02-21 diff --git a/reqwest-tracing/Cargo.toml b/reqwest-tracing/Cargo.toml index e443013..2cb6eb2 100644 --- a/reqwest-tracing/Cargo.toml +++ b/reqwest-tracing/Cargo.toml @@ -15,6 +15,7 @@ opentelemetry_0_14 = ["opentelemetry_0_14_pkg", "tracing-opentelemetry_0_13_pkg" opentelemetry_0_15 = ["opentelemetry_0_15_pkg", "tracing-opentelemetry_0_14_pkg"] opentelemetry_0_16 = ["opentelemetry_0_16_pkg", "tracing-opentelemetry_0_16_pkg"] opentelemetry_0_17 = ["opentelemetry_0_17_pkg", "tracing-opentelemetry_0_17_pkg"] +opentelemetry_0_18 = ["opentelemetry_0_18_pkg", "tracing-opentelemetry_0_18_pkg"] [dependencies] @@ -31,11 +32,13 @@ opentelemetry_0_14_pkg = { package = "opentelemetry", version = "0.14", optional opentelemetry_0_15_pkg = { package = "opentelemetry", version = "0.15", optional = true } opentelemetry_0_16_pkg = { package = "opentelemetry", version = "0.16", optional = true } opentelemetry_0_17_pkg = { package = "opentelemetry", version = "0.17", optional = true } +opentelemetry_0_18_pkg = { package = "opentelemetry", version = "0.18", optional = true } tracing-opentelemetry_0_12_pkg = { package = "tracing-opentelemetry",version = "0.12", optional = true } tracing-opentelemetry_0_13_pkg = { package = "tracing-opentelemetry", version = "0.13", optional = true } tracing-opentelemetry_0_14_pkg = { package = "tracing-opentelemetry",version = "0.14", optional = true } tracing-opentelemetry_0_16_pkg = { package = "tracing-opentelemetry",version = "0.16", optional = true } tracing-opentelemetry_0_17_pkg = { package = "tracing-opentelemetry",version = "0.17", optional = true } +tracing-opentelemetry_0_18_pkg = { package = "tracing-opentelemetry",version = "0.18", optional = true } [dev-dependencies] diff --git a/reqwest-tracing/README.md b/reqwest-tracing/README.md index 57a7edf..f81ebb2 100644 --- a/reqwest-tracing/README.md +++ b/reqwest-tracing/README.md @@ -16,14 +16,14 @@ Attach `TracingMiddleware` to your client to automatically trace HTTP requests: # Cargo.toml # ... [dependencies] -opentelemetry = "0.17" +opentelemetry = "0.18" reqwest = "0.11" reqwest-middleware = "0.1.1" reqwest-retry = "0.1.1" -reqwest-tracing = { version = "0.3.0", features = ["opentelemetry_0_17"] } +reqwest-tracing = { version = "0.3.1", features = ["opentelemetry_0_18"] } tokio = { version = "1.12.0", features = ["macros", "rt-multi-thread"] } tracing = "0.1" -tracing-opentelemetry = "0.17" +tracing-opentelemetry = "0.18" tracing-subscriber = "0.3" ``` @@ -88,10 +88,10 @@ an opentelemetry version feature: ```toml [dependencies] # ... -reqwest-tracing = { version = "0.1.0", features = ["opentelemetry_0_17"] } +reqwest-tracing = { version = "0.3.1", features = ["opentelemetry_0_18"] } ``` -Available opentelemetry features are `opentelemetry_0_17`, `opentelemetry_0_16`, `opentelemetry_0_15`, `opentelemetry_0_14` and +Available opentelemetry features are `opentelemetry_0_18`, `opentelemetry_0_17`, `opentelemetry_0_16`, `opentelemetry_0_15`, `opentelemetry_0_14` and `opentelemetry_0_13`. #### License diff --git a/reqwest-tracing/src/lib.rs b/reqwest-tracing/src/lib.rs index 0b36cb9..dfd72bf 100644 --- a/reqwest-tracing/src/lib.rs +++ b/reqwest-tracing/src/lib.rs @@ -41,6 +41,7 @@ mod middleware; feature = "opentelemetry_0_15", feature = "opentelemetry_0_16", feature = "opentelemetry_0_17", + feature = "opentelemetry_0_18", ))] mod otel; mod reqwest_otel_span_builder; diff --git a/reqwest-tracing/src/middleware.rs b/reqwest-tracing/src/middleware.rs index 1231bc6..6342f61 100644 --- a/reqwest-tracing/src/middleware.rs +++ b/reqwest-tracing/src/middleware.rs @@ -52,6 +52,7 @@ where feature = "opentelemetry_0_15", feature = "opentelemetry_0_16", feature = "opentelemetry_0_17", + feature = "opentelemetry_0_18", ))] let req = crate::otel::inject_opentelemetry_context_into_request(req); diff --git a/reqwest-tracing/src/otel.rs b/reqwest-tracing/src/otel.rs index 0430041..a57e02d 100644 --- a/reqwest-tracing/src/otel.rs +++ b/reqwest-tracing/src/otel.rs @@ -18,6 +18,9 @@ use opentelemetry_0_16_pkg as opentelemetry; #[cfg(feature = "opentelemetry_0_17")] use opentelemetry_0_17_pkg as opentelemetry; +#[cfg(feature = "opentelemetry_0_18")] +use opentelemetry_0_18_pkg as opentelemetry; + #[cfg(feature = "opentelemetry_0_13")] pub use tracing_opentelemetry_0_12_pkg as tracing_opentelemetry; @@ -33,6 +36,9 @@ pub use tracing_opentelemetry_0_16_pkg as tracing_opentelemetry; #[cfg(feature = "opentelemetry_0_17")] pub use tracing_opentelemetry_0_17_pkg as tracing_opentelemetry; +#[cfg(feature = "opentelemetry_0_18")] +pub use tracing_opentelemetry_0_18_pkg as tracing_opentelemetry; + use opentelemetry::global; use opentelemetry::propagation::Injector; use tracing_opentelemetry::OpenTelemetrySpanExt;