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

tracing: in_current_span correct? #12

Open
xd009642 opened this issue Jul 30, 2024 · 0 comments
Open

tracing: in_current_span correct? #12

xd009642 opened this issue Jul 30, 2024 · 0 comments

Comments

@xd009642
Copy link
Owner

Is it necessary to have your root span instrumenting all the tasks you spawn directly?
Because you're going to end up with a situation where you see the same span active in multiple places at the same time (assuming multi-threaded tokio runtime).
Which could be confusing.
You could instead instrument with a new span that has the root span as its parent.

so all uses of in_current_span might be incorrect? But if so how to fix it. I've always utilised it because it makes the parent/child relationships of spans show up correctly and I don't get detached root spans. I did give a try to .instrument(info_span!("name")) as an alternative but with the client receiver I ended up with a disconnected root span 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant