pub fn trace<F>(func: F) -> Trace<F>
Expand description
Create a wrapping filter that instruments every request with a custom
tracing
Span
provided by a function.
§Example
use warp::Filter;
let route = warp::any()
.map(warp::reply)
.with(warp::trace(|info| {
// Create a span using tracing macros
tracing::info_span!(
"request",
method = %info.method(),
path = %info.path(),
)
}));