Make clear examples are just examples (#63)

pull/64/head
Robert Collins 2022-11-07 07:51:40 +01:00 committed by GitHub
parent 0f7c2e15fa
commit ddd7e12104
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -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;

View File

@ -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`.