forked from mirror/reqwest-middleware
parent
53b8b066f3
commit
7b288f582b
|
@ -14,6 +14,8 @@ opentelemetry_0_13 = ["opentelemetry_0_13_pkg", "tracing-opentelemetry_0_12_pkg"
|
||||||
opentelemetry_0_14 = ["opentelemetry_0_14_pkg", "tracing-opentelemetry_0_13_pkg"]
|
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"]
|
||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
reqwest-middleware = { version = "^0.1.5-alpha.0", path = "../reqwest-middleware" }
|
reqwest-middleware = { version = "^0.1.5-alpha.0", path = "../reqwest-middleware" }
|
||||||
|
@ -28,10 +30,13 @@ opentelemetry_0_13_pkg = { package = "opentelemetry", version = "0.13", optional
|
||||||
opentelemetry_0_14_pkg = { package = "opentelemetry", version = "0.14", optional = true }
|
opentelemetry_0_14_pkg = { package = "opentelemetry", version = "0.14", optional = true }
|
||||||
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 }
|
||||||
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 }
|
||||||
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
wiremock = "0.5"
|
wiremock = "0.5"
|
||||||
|
|
|
@ -16,11 +16,11 @@ Attach `TracingMiddleware` to your client to automatically trace HTTP requests:
|
||||||
# Cargo.toml
|
# Cargo.toml
|
||||||
# ...
|
# ...
|
||||||
[dependencies]
|
[dependencies]
|
||||||
opentelemetry = "0.16"
|
opentelemetry = "0.17"
|
||||||
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.1.2", features = ["opentelemetry_0_16"] }
|
reqwest-tracing = { version = "0.1.2", features = ["opentelemetry_0_17"] }
|
||||||
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.15"
|
tracing-opentelemetry = "0.15"
|
||||||
|
@ -69,10 +69,10 @@ an opentelemetry version feature:
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# ...
|
# ...
|
||||||
reqwest-tracing = { version = "0.1.0", features = ["opentelemetry_0_16"] }
|
reqwest-tracing = { version = "0.1.0", features = ["opentelemetry_0_17"] }
|
||||||
```
|
```
|
||||||
|
|
||||||
Available opentelemetry features are `opentelemetry_0_16`, `opentelemetry_0_15`, `opentelemetry_0_14` and
|
Available opentelemetry features are `opentelemetry_0_17`, `opentelemetry_0_16`, `opentelemetry_0_15`, `opentelemetry_0_14` and
|
||||||
`opentelemetry_0_13`.
|
`opentelemetry_0_13`.
|
||||||
|
|
||||||
#### License
|
#### License
|
||||||
|
|
|
@ -8,6 +8,7 @@ mod middleware;
|
||||||
feature = "opentelemetry_0_14",
|
feature = "opentelemetry_0_14",
|
||||||
feature = "opentelemetry_0_15",
|
feature = "opentelemetry_0_15",
|
||||||
feature = "opentelemetry_0_16",
|
feature = "opentelemetry_0_16",
|
||||||
|
feature = "opentelemetry_0_17",
|
||||||
))]
|
))]
|
||||||
mod otel;
|
mod otel;
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ impl Middleware for TracingMiddleware {
|
||||||
feature = "opentelemetry_0_14",
|
feature = "opentelemetry_0_14",
|
||||||
feature = "opentelemetry_0_15",
|
feature = "opentelemetry_0_15",
|
||||||
feature = "opentelemetry_0_16",
|
feature = "opentelemetry_0_16",
|
||||||
|
feature = "opentelemetry_0_17",
|
||||||
))]
|
))]
|
||||||
let req = crate::otel::inject_opentracing_context_into_request(&request_span, req);
|
let req = crate::otel::inject_opentracing_context_into_request(&request_span, req);
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,9 @@ use opentelemetry_0_15_pkg as opentelemetry;
|
||||||
#[cfg(feature = "opentelemetry_0_16")]
|
#[cfg(feature = "opentelemetry_0_16")]
|
||||||
use opentelemetry_0_16_pkg as opentelemetry;
|
use opentelemetry_0_16_pkg as opentelemetry;
|
||||||
|
|
||||||
|
#[cfg(feature = "opentelemetry_0_17")]
|
||||||
|
use opentelemetry_0_17_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;
|
||||||
|
|
||||||
|
@ -27,6 +30,9 @@ pub use tracing_opentelemetry_0_14_pkg as tracing_opentelemetry;
|
||||||
#[cfg(feature = "opentelemetry_0_16")]
|
#[cfg(feature = "opentelemetry_0_16")]
|
||||||
pub use tracing_opentelemetry_0_16_pkg as tracing_opentelemetry;
|
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;
|
||||||
|
|
||||||
use opentelemetry::global;
|
use opentelemetry::global;
|
||||||
use opentelemetry::propagation::Injector;
|
use opentelemetry::propagation::Injector;
|
||||||
use tracing_opentelemetry::OpenTelemetrySpanExt;
|
use tracing_opentelemetry::OpenTelemetrySpanExt;
|
||||||
|
|
Loading…
Reference in New Issue