console
console copied to clipboard
Don't send task names as strings
What problem are you trying to solve?
Currently task names are sent as strings to tokio-console (the instrumentation client).
Instead they should be sent as metadata and the field value should be sent as a reference to the metadata element. This will reduce the data sent over the wire, especially in cases where a task with a fixed name is repeatedly spawned.
See comment for reference: https://github.com/tokio-rs/console/pull/452#discussion_r1316158519
How should the problem be solved?
Send task names as metadata and reference the metadata in the spawn event.
Hi @hds, I am interested in implementing this feature. I believe we need to update the Field to expose the ID, as currently, we can only retrieve its name from the public API. Or have I misunderstood this feature?
@hi-rustin that's correct, this change will require an upstream change in tracing
to expose the numeric index of a tracing::field::Field
. I'm happy to merge a PR that makes such a change.
I'm happy to merge a PR that makes such a change.
Thanks for your reply! I've submitted https://github.com/tokio-rs/tracing/pull/2820.