Remove userAgent tag from HttpClient activity (#5110)

This commit is contained in:
Vishwesh Bankwar 2023-12-01 14:43:05 -08:00 committed by GitHub
parent 61c6c748ad
commit 94c20c684b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 9 deletions

View File

@ -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

View File

@ -167,15 +167,6 @@ internal sealed class HttpHandlerDiagnosticListener : ListenerHandler
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);