-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Milestone
Description
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()andEnum.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.
Metadata
Metadata
Assignees
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions