Review types passed to metrics tags #48530
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Milestone
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
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.The text was updated successfully, but these errors were encountered: