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

Don't send task names as strings #462

Open
hds opened this issue Sep 6, 2023 · 3 comments
Open

Don't send task names as strings #462

hds opened this issue Sep 6, 2023 · 3 comments
Labels
S-feature Severity: feature. This is adding a new feature.

Comments

@hds
Copy link
Collaborator

hds commented Sep 6, 2023

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: #452 (comment)

How should the problem be solved?

Send task names as metadata and reference the metadata in the spawn event.

@hds hds added the S-feature Severity: feature. This is adding a new feature. label Sep 6, 2023
@Rustin170506
Copy link
Collaborator

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?

@hawkw
Copy link
Member

hawkw commented Nov 28, 2023

@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.

@Rustin170506
Copy link
Collaborator

I'm happy to merge a PR that makes such a change.

Thanks for your reply! I've submitted tokio-rs/tracing#2820.

hds added a commit to tokio-rs/tracing that referenced this issue Nov 18, 2024
## Motivation

Expose the index of the field in order to support cases such as sending field information
by index instead of by the string name in Tokio Console. Details:
tokio-rs/console#462 (comment)

## Solution

Adds a new API which exposes the index of a field, which is how it is stored internally
(together with a reference to the `FieldSet` containing the ordered field names.

Signed-off-by: hi-rustin <[email protected]>
Co-authored-by: Hayden Stainsby <[email protected]>
hds added a commit to tokio-rs/tracing that referenced this issue Nov 22, 2024
## Motivation

Expose the index of the field in order to support cases such as sending field information
by index instead of by the string name in Tokio Console. Details:
tokio-rs/console#462 (comment)

## Solution

Adds a new API which exposes the index of a field, which is how it is stored internally
(together with a reference to the `FieldSet` containing the ordered field names.

Signed-off-by: hi-rustin <[email protected]>
Co-authored-by: Hayden Stainsby <[email protected]>
hds added a commit to tokio-rs/tracing that referenced this issue Nov 22, 2024
## Motivation

Expose the index of the field in order to support cases such as sending field information
by index instead of by the string name in Tokio Console. Details:
tokio-rs/console#462 (comment)

## Solution

Adds a new API which exposes the index of a field, which is how it is stored internally
(together with a reference to the `FieldSet` containing the ordered field names.

Signed-off-by: hi-rustin <[email protected]>
Co-authored-by: Hayden Stainsby <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-feature Severity: feature. This is adding a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants