Skip to content

error.type attribute value of http.server.request.duration metric #51620

@vishweshbankwar

Description

@vishweshbankwar

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:

// 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 abstractions

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions