Skip to content

How to display the span id in a log message? #2483

Answered by davidbarsky
zeodtr asked this question in Q&A
Discussion options

You must be logged in to vote

Without it, I must add an artificial id for the instrument macro instance.

What you're writing isn't really an artificial ID—it's an ID that makes sense for your application or library. tracing's span IDs are generally meant to be opaque identifiers that are unique within a process for currently open spans. They are not meant to be globally unique identifiers like UUIDs. If you'd like to read more, take a look at this documentation.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@zeodtr
Comment options

Answer selected by zeodtr
Comment options

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