-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add all named fields to the span name #7
Conversation
Can you please add a test that makes sure both branches are exercised? |
Done. I ran |
I won't be able to look at/verify/check this for a couple more days, but I'm keeping the tab open as a reminder. If I don't get back to this please ping me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried running the newly added tests locally and checked them in Tracy, but I'm failing to see the change in behaviour I would intuitively expect from this PR. Am I missing something?
EDIT: to elaborate, I was expecting to see the name = test
to show up somewhere in the trace, but I'm not and the span that gets recorded is named just "a sec"
still.
let name = if let Some(fields) = span_data.extensions().get::<FormattedFields<F>>() { | ||
format!("{}: {}", metadata.name(), fields.fields.as_str()) | ||
} else { | ||
metadata.name().to_string() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a Cow<'_, str>
here, perhaps? It would also make sense to me to lift and duplicate the Span::new
call into the conditional here.
This has been adapted and merged into main branch. Will be released shortly. |
This makes spans much more useful for me so I can see all the additional metadata in Tracy. Particularly having a span in bevy with a name of
"system"
and a field likename = system.name()
, with this PR I can tell what systems are what in Tracy. I'm open to input for how to improve it.