forked from mirror/reqwest-middleware
Make clear examples are just examples (#63)
parent
0f7c2e15fa
commit
ddd7e12104
|
@ -3,6 +3,8 @@
|
||||||
//! Attach [`TracingMiddleware`] to your client to automatically trace HTTP requests.
|
//! Attach [`TracingMiddleware`] to your client to automatically trace HTTP requests.
|
||||||
//!
|
//!
|
||||||
//! In this example we define a custom span builder to calculate the request time elapsed and we register the [`TracingMiddleware`].
|
//! In this example we define a custom span builder to calculate the request time elapsed and we register the [`TracingMiddleware`].
|
||||||
|
//!
|
||||||
|
//! Note that Opentelemetry tracks start and stop already, there is no need to have a custom builder like this.
|
||||||
//! ```rust
|
//! ```rust
|
||||||
//! use reqwest_middleware::Result;
|
//! use reqwest_middleware::Result;
|
||||||
//! use task_local_extensions::Extensions;
|
//! use task_local_extensions::Extensions;
|
||||||
|
|
|
@ -60,6 +60,7 @@
|
||||||
/// # let request: &reqwest::Request = todo!();
|
/// # let request: &reqwest::Request = todo!();
|
||||||
///
|
///
|
||||||
/// // Define a `time_elapsed` field as empty. It might be populated later.
|
/// // Define a `time_elapsed` field as empty. It might be populated later.
|
||||||
|
/// // (This example is just to show how to inject data - otel already tracks durations)
|
||||||
/// reqwest_otel_span!(request, time_elapsed = tracing::field::Empty);
|
/// reqwest_otel_span!(request, time_elapsed = tracing::field::Empty);
|
||||||
///
|
///
|
||||||
/// // Define a `name` field with a known value, `AppName`.
|
/// // Define a `name` field with a known value, `AppName`.
|
||||||
|
|
Loading…
Reference in New Issue