-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components
Milestone
Description
Blazor metrics add "unknown" as a tag value when a value for the tag hasn't been passed in:
aspnetcore/src/Components/Components/src/ComponentsMetrics.cs
Lines 83 to 88 in 8aa92d9
var tags = new TagList | |
{ | |
{ "aspnetcore.components.type", componentType ?? "unknown" }, | |
{ "code.function.name", methodName ?? "unknown" }, | |
{ "aspnetcore.components.attribute.name", attributeName ?? "unknown" } | |
}; |
I don't think this is the right behavior.
All tags don't always need to be present on telemetrymeasurement. It's common for tags to be conditional and only added when needed or a value is known. For example, if a HTTP request doesn't specify a user-agent, no user agent tag is added to the activity.
A more standard behavior is to not include tags when no value is available for it.
For example,
aspnetcore/src/Identity/Core/src/SignInManagerMetrics.cs
Lines 178 to 184 in 8aa92d9
private static void AddIsPersistent(ref TagList tags, bool? isPersistent) | |
{ | |
if (isPersistent != null) | |
{ | |
tags.Add("aspnetcore.authentication.is_persistent", isPersistent.Value); | |
} | |
} |
Copilot
Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components