Replies: 1 comment 8 replies
-
It depends on the logging layer, if you're using fmt subscriber provided in tracing-subscriber, you're probably looking for with_current_span or with_span_list. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Most of my functions are decorated with
#[tracing:instrument]
and sometimes I store the span field information in the definition too, or usespan.record()
to store the metadata later calculated in the function.What I'd like to know is whether it is possible for
info!()
logs to inherit the metadata of the span so that it can be written to stdout as part of the normal log message?The purpose is that whilst I might look at traces in something like Tempo where that metadata exists, I also like to be able to query the logs system directly.
Currently I have to duplicate the metadata for each
info!()
statement, which can mean up-to 10 pieces of duplicated metadata written per statement for a given function.Beta Was this translation helpful? Give feedback.
All reactions