forked from mirror/reqwest-middleware
chore: correct OpenTracing -> OpenTelemetry (#34)
parent
5f180155ef
commit
643f47ad92
|
@ -6,7 +6,7 @@ edition = "2018"
|
||||||
description = "Opentracing middleware for reqwest."
|
description = "Opentracing middleware for reqwest."
|
||||||
repository = "https://github.com/TrueLayer/reqwest-middleware"
|
repository = "https://github.com/TrueLayer/reqwest-middleware"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
keywords = ["reqwest", "http", "middleware", "opentracing", "tracing"]
|
keywords = ["reqwest", "http", "middleware", "opentelemetry", "tracing"]
|
||||||
categories = ["web-programming::http-client"]
|
categories = ["web-programming::http-client"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|
|
@ -38,7 +38,7 @@ impl Middleware for TracingMiddleware {
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Adds tracing headers to the given request to propagate the OpenTracing context to downstream revivers of the request.
|
// Adds tracing headers to the given request to propagate the OpenTelemetry context to downstream revivers of the request.
|
||||||
// Spans added by downstream consumers will be part of the same trace.
|
// Spans added by downstream consumers will be part of the same trace.
|
||||||
#[cfg(any(
|
#[cfg(any(
|
||||||
feature = "opentelemetry_0_13",
|
feature = "opentelemetry_0_13",
|
||||||
|
@ -47,7 +47,7 @@ impl Middleware for TracingMiddleware {
|
||||||
feature = "opentelemetry_0_16",
|
feature = "opentelemetry_0_16",
|
||||||
feature = "opentelemetry_0_17",
|
feature = "opentelemetry_0_17",
|
||||||
))]
|
))]
|
||||||
let req = crate::otel::inject_opentracing_context_into_request(&request_span, req);
|
let req = crate::otel::inject_opentelemetry_context_into_request(&request_span, req);
|
||||||
|
|
||||||
// Run the request
|
// Run the request
|
||||||
let outcome = next.run(req, extensions).await;
|
let outcome = next.run(req, extensions).await;
|
||||||
|
|
|
@ -37,8 +37,8 @@ use opentelemetry::global;
|
||||||
use opentelemetry::propagation::Injector;
|
use opentelemetry::propagation::Injector;
|
||||||
use tracing_opentelemetry::OpenTelemetrySpanExt;
|
use tracing_opentelemetry::OpenTelemetrySpanExt;
|
||||||
|
|
||||||
/// Injects the given Opentelemetry Context into a reqwest::Request headers to allow propagation downstream.
|
/// Injects the given OpenTelemetry Context into a reqwest::Request headers to allow propagation downstream.
|
||||||
pub fn inject_opentracing_context_into_request(span: &Span, request: Request) -> Request {
|
pub fn inject_opentelemetry_context_into_request(span: &Span, request: Request) -> Request {
|
||||||
let context = span.context();
|
let context = span.context();
|
||||||
let mut request = request;
|
let mut request = request;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue