Skip to content
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

"{}" as span names #689

Open
nekto0n opened this issue Mar 26, 2024 · 1 comment
Open

"{}" as span names #689

nekto0n opened this issue Mar 26, 2024 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers zbus Issues/PRs related to zbus crate

Comments

@nekto0n
Copy link

nekto0n commented Mar 26, 2024

Hi!
Noticed strangely named spans, which are literally {}. Examples include:

.instrument(info_span!("{}", lost_task_name)),

.instrument(info_span!("{}", task_name)),

.instrument(info_span!("{}", task_name));

Looking at the history it looks like the intention was to assign a literal string to a variable to be able to reuse for other purposes.

If I am reading this correctly, then the proper solution would look like:

.instrument(info_span!(name: task_name))
@zeenix
Copy link
Contributor

zeenix commented Mar 26, 2024

Looking at the history it looks like the intention was to assign a literal string to a variable to be able to reuse for other purposes.

Actually, the intention was just to assign a name/string to the task so traces include the context.

If I am reading this correctly, then the proper solution would look like:

.instrument(info_span!(name: task_name))

hmm.. can it just be:

.instrument(info_span!(task_name))

In either case, a PR would be most welcome.

@zeenix zeenix added bug Something isn't working good first issue Good for newcomers zbus Issues/PRs related to zbus crate labels Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers zbus Issues/PRs related to zbus crate
Projects
None yet
Development

No branches or pull requests

2 participants