Skip to content

fix(otlp): don't configure an automatic OTel propagator#5319

Open
jamescrosswell wants to merge 2 commits into
mainfrom
fix/issue-5299-otlp-no-auto-propagator
Open

fix(otlp): don't configure an automatic OTel propagator#5319
jamescrosswell wants to merge 2 commits into
mainfrom
fix/issue-5299-otlp-no-auto-propagator

Conversation

@jamescrosswell

Copy link
Copy Markdown
Collaborator

Closes #5299

Summary

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.

Our OTLP exporter was inconsistent with this: AddSentryOtlpExporter (and UseOtlp) called Sdk.SetDefaultTextMapPropagator(new SentryPropagator()), automatically configuring a global propagator. This brings us in line with the spec and with our other OTLP integrations.

Changes

  • Remove the Sdk.SetDefaultTextMapPropagator(...) call from AddSentryOtlpExporter.
  • Remove the now-purposeless defaultTextMapPropagator parameter from both AddSentryOtlpExporter and SentryOptionsExtensions.UseOtlp.
  • Update XML docs to point users at PropagateTraceparent / their own OTel propagator config.
  • Drop the obsolete custom-propagator test; add a regression test asserting AddSentryOtlpExporter leaves Propagators.DefaultTextMapPropagator untouched.

⚠️ Breaking API change. The defaultTextMapPropagator parameter shipped in 6.5.0/6.6.0 and is removed here (source + binary breaking for anyone who passed it). Flagging for a call on whether this should land in a major, or whether you'd prefer to [Obsolete] the parameter first. Note the classic (non-OTLP) Sentry.OpenTelemetry package is intentionally left unchanged — it still requires SentryPropagator.

Users who want cross-service propagation should now either set SentryOptions.PropagateTraceparent or configure OpenTelemetry propagators themselves (e.g. Sdk.SetDefaultTextMapPropagator(...)).

Follow-up

🤖 Generated with Claude Code

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

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.16%. Comparing base (6690704) to head (87baa96).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/Sentry.OpenTelemetry.Exporter/SentryOptionsExtensions.cs
Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com>
@jamescrosswell jamescrosswell marked this pull request as ready for review June 26, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable automatic propagator for OTLP

1 participant