fix: add tracing calls to tracing-aka-logging example closures (#3722)

This commit is contained in:
Dihan Nahdi
2026-04-15 11:34:16 +02:00
committed by GitHub
parent 7dcc0db31e
commit 7be02d7754
+5 -4
View File
@@ -65,21 +65,22 @@ async fn main() {
// You can use `_span.record("some_other_field", value)` in one of these
// closures to attach a value to the initially empty field in the info_span
// created above.
tracing::debug!("started processing request")
})
.on_response(|_response: &Response, _latency: Duration, _span: &Span| {
// ...
tracing::debug!("finished processing request")
})
.on_body_chunk(|_chunk: &Bytes, _latency: Duration, _span: &Span| {
// ...
tracing::debug!("sending body chunk")
})
.on_eos(
|_trailers: Option<&HeaderMap>, _stream_duration: Duration, _span: &Span| {
// ...
tracing::debug!("stream closed")
},
)
.on_failure(
|_error: ServerErrorsFailureClass, _latency: Duration, _span: &Span| {
// ...
tracing::error!("something went wrong")
},
),
);