Skip to content

How come #[instrument] isn't doing anything? #6013

Answered by tobymurray
tobymurray asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tobymurray
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant