Opentelemetry 0.18 (#58)

* Support for opentelemetry 0.18

* Updated changelog

* Update CI/CD to test 0.18

* Update documentation to use opentelemetry 0.18

* Update to use 0.18 in libs
This commit is contained in:
birkmose 2022-09-20 15:07:32 +02:00 committed by GitHub
parent e2635c9f8d
commit dd877924c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 5 deletions

View file

@ -17,6 +17,7 @@ jobs:
- opentelemetry_0_15 - opentelemetry_0_15
- opentelemetry_0_16 - opentelemetry_0_16
- opentelemetry_0_17 - opentelemetry_0_17
- opentelemetry_0_18
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -61,6 +62,7 @@ jobs:
- opentelemetry_0_15 - opentelemetry_0_15
- opentelemetry_0_16 - opentelemetry_0_16
- opentelemetry_0_17 - opentelemetry_0_17
- opentelemetry_0_18
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -88,6 +90,7 @@ jobs:
- opentelemetry_0_15 - opentelemetry_0_15
- opentelemetry_0_16 - opentelemetry_0_16
- opentelemetry_0_17 - opentelemetry_0_17
- opentelemetry_0_18
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v2

View file

@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Implementation of `Debug` trait for `RequestBuilder`. - Implementation of `Debug` trait for `RequestBuilder`.
- Added support for `opentelemetry` version `0.18`.
## [0.1.5] - 2022-02-21 ## [0.1.5] - 2022-02-21

View file

@ -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_15 = ["opentelemetry_0_15_pkg", "tracing-opentelemetry_0_14_pkg"]
opentelemetry_0_16 = ["opentelemetry_0_16_pkg", "tracing-opentelemetry_0_16_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_17 = ["opentelemetry_0_17_pkg", "tracing-opentelemetry_0_17_pkg"]
opentelemetry_0_18 = ["opentelemetry_0_18_pkg", "tracing-opentelemetry_0_18_pkg"]
[dependencies] [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_15_pkg = { package = "opentelemetry", version = "0.15", optional = true }
opentelemetry_0_16_pkg = { package = "opentelemetry", version = "0.16", 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_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_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_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_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_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_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] [dev-dependencies]

View file

@ -16,14 +16,14 @@ Attach `TracingMiddleware` to your client to automatically trace HTTP requests:
# Cargo.toml # Cargo.toml
# ... # ...
[dependencies] [dependencies]
opentelemetry = "0.17" opentelemetry = "0.18"
reqwest = "0.11" reqwest = "0.11"
reqwest-middleware = "0.1.1" reqwest-middleware = "0.1.1"
reqwest-retry = "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"] } tokio = { version = "1.12.0", features = ["macros", "rt-multi-thread"] }
tracing = "0.1" tracing = "0.1"
tracing-opentelemetry = "0.17" tracing-opentelemetry = "0.18"
tracing-subscriber = "0.3" tracing-subscriber = "0.3"
``` ```
@ -88,10 +88,10 @@ an opentelemetry version feature:
```toml ```toml
[dependencies] [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`. `opentelemetry_0_13`.
#### License #### License

View file

@ -41,6 +41,7 @@ mod middleware;
feature = "opentelemetry_0_15", feature = "opentelemetry_0_15",
feature = "opentelemetry_0_16", feature = "opentelemetry_0_16",
feature = "opentelemetry_0_17", feature = "opentelemetry_0_17",
feature = "opentelemetry_0_18",
))] ))]
mod otel; mod otel;
mod reqwest_otel_span_builder; mod reqwest_otel_span_builder;

View file

@ -52,6 +52,7 @@ where
feature = "opentelemetry_0_15", feature = "opentelemetry_0_15",
feature = "opentelemetry_0_16", feature = "opentelemetry_0_16",
feature = "opentelemetry_0_17", feature = "opentelemetry_0_17",
feature = "opentelemetry_0_18",
))] ))]
let req = crate::otel::inject_opentelemetry_context_into_request(req); let req = crate::otel::inject_opentelemetry_context_into_request(req);

View file

@ -18,6 +18,9 @@ use opentelemetry_0_16_pkg as opentelemetry;
#[cfg(feature = "opentelemetry_0_17")] #[cfg(feature = "opentelemetry_0_17")]
use opentelemetry_0_17_pkg as opentelemetry; use opentelemetry_0_17_pkg as opentelemetry;
#[cfg(feature = "opentelemetry_0_18")]
use opentelemetry_0_18_pkg as opentelemetry;
#[cfg(feature = "opentelemetry_0_13")] #[cfg(feature = "opentelemetry_0_13")]
pub use tracing_opentelemetry_0_12_pkg as tracing_opentelemetry; 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")] #[cfg(feature = "opentelemetry_0_17")]
pub use tracing_opentelemetry_0_17_pkg as tracing_opentelemetry; 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::global;
use opentelemetry::propagation::Injector; use opentelemetry::propagation::Injector;
use tracing_opentelemetry::OpenTelemetrySpanExt; use tracing_opentelemetry::OpenTelemetrySpanExt;