diff --git a/src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md index 43b52675428..e698306f061 100644 --- a/src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md @@ -23,6 +23,9 @@ `HttpClientTraceInstrumentationOptions`. ([#5109](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5109)) +* **Breaking Change**: Removed `http.user_agent` tag from HttpClient activity. + ([#5110](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5110)) + ## 1.6.0-beta.3 Released 2023-Nov-17 diff --git a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs index 33b3a3d1398..ff3fa2022e3 100644 --- a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs +++ b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs @@ -167,15 +167,6 @@ public void OnStartActivity(Activity activity, object payload) activity.SetTag(SemanticConventions.AttributeUrlFull, HttpTagHelper.GetUriTagValueFromRequestUri(request.RequestUri)); - if (request.Headers.TryGetValues("User-Agent", out var userAgentValues)) - { - var userAgent = userAgentValues.FirstOrDefault(); - if (!string.IsNullOrEmpty(userAgent)) - { - activity.SetTag(SemanticConventions.AttributeHttpUserAgent, userAgent); - } - } - try { this.options.EnrichWithHttpRequestMessage?.Invoke(activity, request);