xd009642 / streamer-template

Part of series on bidirectional streaming audio APIs
MIT License
6 stars 0 forks source link

tracing: in_current_span correct? #12

Open xd009642 opened 3 months ago

xd009642 commented 3 months ago

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 :thinking: