Open hds opened 1 year ago
This sounds reasonable to me. You should probably coordinate with @carllerche's scheduler refactor, which may change the same parts of the codebase.
A task may outlive the context in which is was spawned (and frequently does).
@hds What about block_on
?
This runs the given future on the current thread, blocking until it is complete
Looks like him span should have parent
.
A task may outlive the context in which is was spawned (and frequently does).
@hds What about
block_on
?This runs the given future on the current thread, blocking until it is complete
Looks like him span should have
parent
.
This is something we should consider. We've taken it out for now, but a subscriber could still get the context for that span and store it if it needed to.
Is your feature request related to a problem? Please describe. The traces produced by Tokio are great, however there are some areas in which the hierarchy in which the traces are emitted could be improved or doesn't make sense.
Specific issues are:
Describe the solution you'd like
I would like to add some additional traces to Tokio and modify others.
The proposed hierarchy is the following. Sub-items have their span's
parent
set. Values in parentheses are related fields which would be set. Note that all spans have a span ID implicitly, these are used for internal referencing.Further explanation of the structure:
Ideally all these changes, or at least all the breaking ones would make it into the same Tokio release. Preferably with the addition of spans for Runtimes. This would allow Tokio Console to determine the version tokio tracing variant being used and read the traces accordingly.
Describe alternatives you've considered
Parts of this hierarchy can be implemented without the rest. But it makes sense to discuss the entirety.
Additional context
This is mostly considering being consumed by Tokio Console. However it would be interesting to hear from anyone who is using tokio traces in other ways.