A tower-http TraceLayer
that records metrics using the metrics facade.
```rust use towertracemetrics::make_layer; use tower::ServiceBuilder; use bytes;
fn main() { let service = ServiceBuilder::new() // Make a trace layer where the chunks are bytes::Bytes .layer(make_layer(|b: &bytes::Bytes| b.len() as u64)); // ... Use this service in a Tower middleware stack. } ```
Each metric is faceted by path
, method
, and host
for the request.