From 09d8d817637279a8e5a5bff20e76627c34827147 Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Thu, 30 Nov 2023 18:32:58 -0800 Subject: [PATCH 1/2] Remove userAgent tag from HttpClient activity --- .../Implementation/HttpHandlerDiagnosticListener.cs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs index f71707b37a5..1eb45b049fb 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); From ddd8c924a1ef5c5996e79c7139619c42d9ae9b04 Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Fri, 1 Dec 2023 11:40:50 -0800 Subject: [PATCH 2/2] changelog --- src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) 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