Repository navigation
fix(otlp): don't configure an automatic OTel propagator - #5319
Merged
Merged
Conversation
The OTLP integration spec states the integration MUST NOT set up an automatic propagator; cross-service trace propagation is handled by the propagateTraceparent setting or by user-configured OTel propagators. AddSentryOtlpExporter / UseOtlp previously called Sdk.SetDefaultTextMapPropagator(new SentryPropagator()), which is inconsistent with the spec and with our other OTLP integrations. This removes that call and the now-purposeless defaultTextMapPropagator parameter from both public methods. BREAKING CHANGE: removed the defaultTextMapPropagator parameter from AddSentryOtlpExporter and UseOtlp. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## version7 #5319 +/- ##
============================================
- Coverage 74.16% 74.16% -0.01%
============================================
Files 508 508
Lines 18353 18351 -2
Branches 3586 3585 -1
============================================
- Hits 13612 13610 -2
Misses 3869 3869
Partials 872 872 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jamescrosswell
commented
Jun 26, 2026
jamescrosswell
commented
Jun 26, 2026
Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com>
jamescrosswell
marked this pull request as ready for review
June 26, 2026 04:54
Merged
1 of 6 tasks
This was referenced Jul 2, 2026
Contributor
|
@jamescrosswell this should land in the next major, we'll do the same change in Ruby & Python in their next majors |
jamescrosswell
marked this pull request as draft
July 8, 2026 05:44
jamescrosswell
marked this pull request as ready for review
September 6, 2026 22:58
adinauer
approved these changes
Sep 7, 2026
adinauer
left a comment
Member
There was a problem hiding this comment.
LGTM, I assume you'll update docs once v7 is released.
This was referenced Oct 12, 2026
3 tasks done
jamescrosswell
added a commit
to getsentry/sentry-docs
that referenced
this pull request
Nov 11, 2026
> [!NOTE] > This targets `dotnet-v7`, which collects the .NET docs for sentry-dotnet 7.0.0. #20641 merges that branch into `master` when 7.0.0 ships, so this PR can merge into `dotnet-v7` as soon as it's approved. ## DESCRIBE YOUR PR Updates the .NET OTLP page for sentry-dotnet 7.0.0. From 7.0.0, `AddSentryOtlpExporter` no longer installs `SentryPropagator`, and the `defaultTextMapPropagator` parameter is gone from it and from `UseOtlp` (getsentry/sentry-dotnet#5319). - Replaces the `SentryPropagator` bullet and the "Planned Removal" alert with a Trace Propagation section. It covers what gets propagated by default, how to add `SentryPropagator` for services that rely on `sentry-trace`, and when `PropagateTraceparent` helps. A short note covers the pre-7.0.0 behavior. - Removes the `defaultTextMapPropagator` option. - Raises the OpenTelemetry floor in Supported Versions to 1.12.0. - Replaces the note saying not to set `TracesSampleRate` with a Sampling section. With `UseOtlp()` the SDK creates no transactions, so `TracesSampleRate` and `TracesSampler` are never read, and the OTLP exporter installs no OpenTelemetry sampler. Sampling is configured on the `TracerProvider`. This is true for 6.x as well. Closes getsentry/sentry-dotnet#5546 ### Notes for review Where the page differs from the issue, it follows the source on sentry-dotnet's `version7` branch: - **`PropagateTraceparent` doesn't help the OTLP service itself.** OpenTelemetry's default propagator (W3C trace context plus baggage, which the OTel SDK installs) and the .NET runtime already send `traceparent`. OTel's HttpClient instrumentation also overwrites any `traceparent` that `SentryHttpMessageHandler` adds first. A local run against a `version7` build sent identical headers with and without the option. The page recommends it for the Sentry-traced services that call the OTLP service, as `/concepts/otlp/sentry-with-otel/` already does. - **`sentry-trace` doesn't disappear completely.** `UseOtlp()` stops `SentryHttpMessageHandler` from creating spans, but its header propagation still runs (`SentryMessageHandler.PropagateTraceHeaders`). Sentry adds the handler to `IHttpClientFactory` clients when it's set up through DI. Other requests only carry `sentry-trace` if the app configures `SentryPropagator`. - **The 1.12.0 floor already shipped in 6.11.1** (#5560 was backported in getsentry/sentry-dotnet#5588), so that line is correct today and has no "before 7.0.0" note. - `SentryPropagator` is still public in `Sentry.OpenTelemetry.Exporter` on `version7`, so the snippet doesn't need the deprecated `Sentry.OpenTelemetry` package. It derives from `BaggagePropagator`, which is why the composite doesn't list that one separately. The snippet compiles against the `version7` build with OpenTelemetry 1.12.0. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the due date. You can update this information later by editing the PR description. - [x] Urgent deadline (GA date, etc.): 2026-11-30 - [ ] Other deadline: YYYY-MM-DD - [ ] No deadline: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've supplied a deadline. Thanks in advance for your help! ## 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) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: ric-oliv <5938598+ric-oliv@users.noreply.github.com>
27 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5299
Summary
The OTLP integration spec states:
Our OTLP exporter was inconsistent with this:
AddSentryOtlpExporter(andUseOtlp) calledSdk.SetDefaultTextMapPropagator(new SentryPropagator()), automatically configuring a global propagator. This brings us in line with the spec and with our other OTLP integrations.Changes
Sdk.SetDefaultTextMapPropagator(...)call fromAddSentryOtlpExporter.defaultTextMapPropagatorparameter from bothAddSentryOtlpExporterandSentryOptionsExtensions.UseOtlp.PropagateTraceparent/ their own OTel propagator config.AddSentryOtlpExporterleavesPropagators.DefaultTextMapPropagatoruntouched.Users who want cross-service propagation should now either set
SentryOptions.PropagateTraceparentor configure OpenTelemetry propagators themselves (e.g.Sdk.SetDefaultTextMapPropagator(...)).Follow-up
🤖 Generated with Claude Code