-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
open-telemetry/opentelemetry-dotnet
#4986Labels
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
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
The value of error.type attribute on http.server.request.duration does not take the status code in to account as per the spec
If response status code was sent or received and status indicates an error according to HTTP span status definition, error.type SHOULD be set to the status code number (represented as a string), an exception type (if thrown) or a component-specific error identifier.
Src link:
aspnetcore/src/Hosting/Hosting/src/Internal/HostingMetrics.cs
Lines 72 to 77 in e497b5a
| // This exception is only present if there is an unhandled exception. | |
| // An exception caught by ExceptionHandlerMiddleware and DeveloperExceptionMiddleware isn't thrown to here. Instead, those middleware add error.type to custom tags. | |
| if (exception != null) | |
| { | |
| tags.Add("error.type", exception.GetType().FullName); | |
| } |
Expected Behavior
error.type is set to Status Code value as per spec.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
.NET8
Anything else?
No response
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