diff --git a/platform-includes/performance/opentelemetry-setup/dotnet.aspnetcore.mdx b/platform-includes/performance/opentelemetry-setup/dotnet.aspnetcore.mdx index f9f327441370e..c6fea825491d2 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. +