How come #[instrument] isn't doing anything? #6013
-
Following https://tokio.rs/tokio/topics/tracing to add Tracing to my project, I've used |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I fundamentally misunderstood how this was working. Spans by default don't do anything in this context, even with a configured subscriber. They provide contextual information for other spans and events, and that's all. Adding an event (e.g. with the use of the The subscriber can also be configured to log what I was expecting with |
Beta Was this translation helpful? Give feedback.
I fundamentally misunderstood how this was working. Spans by default don't do anything in this context, even with a configured subscriber. They provide contextual information for other spans and events, and that's all. Adding an event (e.g. with the use of the
info!
macro) will show the instrumented function as context for the event.The subscriber can also be configured to log what I was expecting with
with_span_events
, e.g..with_span_events(FmtSpan::FULL)
will show something closer to what I was thinking would be the default.