blob: e2afb3e948c7dd5452e481e1c292c73d55f3dbb5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
use reqwest_tracing::{SpanBackendWithUrl, TracingMiddleware};
/// Returns a new tracing middleware which can be used with reqwest_middleware.
/// It will then write the `traceparent` in the header on the request and additionally records the
/// `url` into `http.url`.
///
/// If otlp feature is disabled, this will not insert a `traceparent` into the header. It will
/// basically function as a noop.
///
/// `traceparent` => https://www.w3.org/TR/trace-context/#trace-context-http-headers-format
pub fn tracing_middleware() -> TracingMiddleware<SpanBackendWithUrl> {
TracingMiddleware::<SpanBackendWithUrl>::new()
}
|