-
Notifications
You must be signed in to change notification settings - Fork 701
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
OpenTelemetry semantic conventions v1.21.0 renamed the http.method
attribute to http.request.method
, and http.status_code
to http.response.status_code
. The .NET Aspire dashboard however recognizes only the old names http.method
and http.status_code
. Now when my service publishes telemetry using the current names http.request.method
and http.response.status_code
, the .NET Aspire dashboard does not understand that the span is for an HTTP client request, and does not show "HTTP" and the HTTP status code in the friendly summary.
Describe the solution you'd like
Recognize the http.request.method
name in addition to http.method
.
When a span has the http.request.method
attribute, recognize the http.response.status_code
name rather than http.status_code
.
Additional context
- OpenTelemetry semantic conventions for HTTP client spans
- Rename
http.*
attributes to align with ECS open-telemetry/opentelemetry-specification#3182 requested the new names. - BREAKING: Introduce common
url.*
attributes, and improve use of namespacing underhttp.*
open-telemetry/opentelemetry-specification#3355 - https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.21.0 mentions this change.
- Add standard tags to HttpClient native trace instrumentation runtime#104251 added the new attributes. AFAICT, HttpClient in .NET never emitted the old attributes
http.method
andhttp.status_code
. - Rename hosting, routing and error handling metrics to be consistent with OpenTelemetry aspnetcore#49743 started using
http.request.method
andhttp.response.status_code
in metrics. Before that, ASP.NET Core usedmethod
andstatus-code
. - Initialize hosting trace with OTEL tags for sampling aspnetcore#62090 started using
http.request.method
in traces.
.NET Aspire dashboard code that recognizes only the old names http.method
and http.status_code
:
aspire/src/Aspire.Dashboard/Otlp/Model/OtlpSpan.cs
Lines 176 to 182 in d9077f9
if (!string.IsNullOrEmpty(OtlpHelpers.GetValue(span.Attributes, "http.method"))) | |
{ | |
var httpMethod = OtlpHelpers.GetValue(span.Attributes, "http.method"); | |
var statusCode = OtlpHelpers.GetValue(span.Attributes, "http.status_code"); | |
return $"HTTP {httpMethod?.ToUpperInvariant()} {statusCode}"; | |
} |