Skip to content

Commit b1bab59

Browse files
Added docs on avoiding duplicate HTTP spans when using OTEL
1 parent ffca9d0 commit b1bab59

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

platform-includes/performance/opentelemetry-setup/dotnet.aspnetcore.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,10 @@ builder.WebHost.UseSentry(options =>
2121
options.SendDefaultPii = true;
2222
options.TracesSampleRate = 1.0;
2323
options.UseOpenTelemetry(); // <-- Configure Sentry to use OpenTelemetry trace information
24+
options.DisableSentryHttpMessageHandler = true; // <-- Disable Sentry's HttpClient instrumentation to avoid duplicate spans
2425
});
2526
```
27+
28+
<Alert level="info" title="Important Note">
29+
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.
30+
</Alert>

0 commit comments

Comments
 (0)