Skip to content

Review types passed to metrics tags #48530

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

Closed
JamesNK opened this issue May 31, 2023 · 2 comments
Closed

Review types passed to metrics tags #48530

JamesNK opened this issue May 31, 2023 · 2 comments
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Comments

@JamesNK
Copy link
Member

JamesNK commented May 31, 2023

Metrics tags sometimes have enum and integer values. Value types always box because tags are stored as KeyValuePair<string, object?>. In some places, we avoid boxing with a cached collection of boxed values.

Note that OTel semantic conventions specify the tag type in some places, such as the HTTP status code is an integer.

Review with metrics experts to ensure we're doing the right thing.

Options

  • Keep passing value types and cache value types on hot path metrics.
  • Convert values to a string before passing to metrics, and rely on built-in caching. For example, Int32.ToString() and Enum.ToString() have some level of caching. The downside is that listeners may need to convert the string value back to its original type to use it.
@JamesNK JamesNK added this to the .NET 8 Planning milestone May 31, 2023
@ghost
Copy link

ghost commented May 31, 2023

Thanks for contacting us.

We're moving this issue to the .NET 8 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@joperezr
Copy link
Member

@JamesNK is there anything left we have to do here?

@JamesNK JamesNK closed this as completed Aug 17, 2023
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 25, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

No branches or pull requests

4 participants
@JamesNK @amcasey @joperezr and others