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
tower
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_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

View File

@ -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

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_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]

View File

@ -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

View File

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

View File

@ -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);

View File

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