Skip to content

Commit edbd361

Browse files
Added docs on avoiding duplicate HTTP spans when using OTEL (#15378)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR Resolves getsentry/sentry-dotnet#4670 ## IS YOUR CHANGE URGENT? - [ ] None: Not urgent, can wait up to 1 week+ ## SLA cc: @Flash0ver ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) Co-authored-by: Michi Hoffmann <cleptric@users.noreply.github.com>
1 parent dc18363 commit edbd361

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)