Skip to content

HTTP OTEL metrics: use error.type instead of exception.type attribute #51029

@lmolkova

Description

@lmolkova

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

OTel recently defined error.type attribute as a general-purpose error status. It is used on http.server.* and other metrics (open-telemetry/semantic-conventions#205).

ASP.NET Core now reports exception.type on .NET-specific metrics like (kestrel.*, aspnetcore.*) as well as common HTTP metrics.

e.g. here

tags.Add("exception.type", exception.GetType().FullName);

Reporting exception.type on common OTel metrics makes .NET incompatible with the OTel spec.

Expected Behavior

ASP.NET Core metrics in http.* namespace should use error.type attribute (populating full exception type on it, in the same was as today).
.NET-specific metrics can keep using exception.type or switch to exception.type.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

8.0

Metadata

Metadata

Assignees

Labels

area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions