-
Notifications
You must be signed in to change notification settings - Fork 731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API inconsistency between event and span argument order #456
Comments
so, the thing is... span!(
Level::DEBUG,
"answering_question"
question.answer = answer,
question.tricky = true,
"the answer to {} is {}.", question, answer
); is also valid. |
Could we perhaps use "special" syntax for a span's name somehow? To make it clear that it's something different from the message? Alternatively, can events also have names? |
Can confirm, I am a tripped-up user! I'm here because I was wondering if I don't know the internals of tracing, but from my brief investigation it looks like hawkw's example sets the formatted string to a "magical" field named
I might have missed something, but I don't think that behavior is even mentioned in the docs. I don't personally see the use for having both a |
I'd like to try to move this forward, so I've tried to compile the current state and list options for unifying the two macros. Event
Span
DifferencesThe only difference is that the name is in another position and that it is required for spans. When a single The thing that is from my perception most often the point of confusion is that fields go before the message in events but after the name in spans (as illustrated in this issue). People also seem to think that the span's name is equivalent to event's message and don't know there's also a formatted message after the fields in spans. The last two points are my personal perceptions and I have no data to support that except for this issue and my experience so I might be wrong there. Options
Current QuestionsI think answering these could help to move this along:
|
Feature Request
span!
currently takes the "name" first, then fields, whereasevent!
takes the fields first then the "message". This means that you end up with the docs showing examples like:The fact that the fields come before the string argument in
span!
, but after the string argument inevent!
is surprising, and will probably trip users up. It'd be good if the two matched up, even though their string arguments are slightly different.The text was updated successfully, but these errors were encountered: