From b1bab594394da59b7e346da109b92294bff245a6 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Mon, 3 Nov 2025 15:02:43 +1300 Subject: [PATCH] Added docs on avoiding duplicate HTTP spans when using OTEL --- .../performance/opentelemetry-setup/dotnet.aspnetcore.mdx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform-includes/performance/opentelemetry-setup/dotnet.aspnetcore.mdx b/platform-includes/performance/opentelemetry-setup/dotnet.aspnetcore.mdx index f9f327441370e7..c6fea825491d24 100644 --- a/platform-includes/performance/opentelemetry-setup/dotnet.aspnetcore.mdx +++ b/platform-includes/performance/opentelemetry-setup/dotnet.aspnetcore.mdx @@ -21,5 +21,10 @@ builder.WebHost.UseSentry(options => options.SendDefaultPii = true; options.TracesSampleRate = 1.0; options.UseOpenTelemetry(); // <-- Configure Sentry to use OpenTelemetry trace information + options.DisableSentryHttpMessageHandler = true; // <-- Disable Sentry's HttpClient instrumentation to avoid duplicate spans }); ``` + + +When using OpenTelemetry to instrument HttpClient spans via `AddHttpClientInstrumentation`, you **must** set `DisableSentryHttpMessageHandler = true` in the Sentry options to disable Sentry's built-in HttpClient instrumentation. This prevents the creation of duplicate spans for HTTP requests. +