mirror of
https://github.com/TrueLayer/reqwest-middleware.git
synced 2024-12-27 03:16:32 +00:00
Make clear examples are just examples (#63)
This commit is contained in:
parent
0f7c2e15fa
commit
ddd7e12104
2 changed files with 3 additions and 0 deletions
|
@ -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 a new issue