Skip to content

fix(otlp)!: Don't set up a propagator by default - #8201

Draft
sentry-junior[bot] wants to merge 2 commits into
major/3.0from
ivana/otlp-remove-propagator
Draft

sentry-junior[bot] wants to merge 2 commits into
major/3.0from
ivana/otlp-remove-propagator

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

The OTLP integration spec says the integration MUST NOT set up an automatic propagator. Cross-service propagation should come from the user's OpenTelemetry propagators instead.

Right now OTLPIntegration replaces the global OTel textmap with SentryOTLPPropagator by default. That means outgoing requests carry only sentry-trace/baggage and drop the W3C traceparent.

This follows the sentry-ruby approach (getsentry/sentry-ruby#3063):

  • setup_propagator now defaults to False, so by default OTLPIntegration leaves the global textmap alone. Users can still opt in with setup_propagator=True.
  • Tests cover both the default (global textmap untouched) and the opt-in. The inject/extract tests opt in explicitly.
  • Added a note to the migration guide. It covers the new default, how to get the old behavior back, and how to send both W3C and Sentry headers with a CompositePropagator.

Without any setup, OTel's default propagators apply (tracecontext + baggage, or whatever OTEL_PROPAGATORS says).

Unlike the Ruby PR, this doesn't change the default of setup_otlp_traces_exporter. The spec says it defaults to True.

Docs (sentry-docs OTLP page) still need to be updated to describe the new default and manual propagator setup. That isn't part of this PR.

Issues

Closes #6732
Closes PY-2574

via Ivana Kellyer.

--

View Session [Sentry]

Per the OTLP integration spec, the OTLPIntegration must not set up an
automatic propagator. Remove the setup_propagator option and stop
replacing the global textmap with SentryOTLPPropagator. The propagator
stays available for manual setup.

Closes #6732

Co-Authored-By: Ivana Kellyer <ivana.kellyer@sentry.io>
@sentry-junior
sentry-junior Bot added this pull request to stack #8202 November 6, 2026 08:28
@linear-code

linear-code Bot commented Nov 6, 2026

Copy link
Copy Markdown

PY-2574

@sentrivana

Copy link
Copy Markdown
Collaborator

@sentry-junior Let's follow the ruby approach of setting the propagator to False by default. Don't remove it outright

@sentry-junior sentry-junior Bot changed the title fix(otlp)!: Don't set up a propagator automatically fix(otlp)!: Don't set up a propagator by default Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 57836 passed | ⏭️ 3008 skipped | Total: 60844 | Pass Rate: 95.06% | Execution Time: 160m 12s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -83534
Passed Tests 📉 -79084
Failed Tests 📉 -2
Skipped Tests 📉 -4448

➖ Removed Tests (2)

View removed tests
  • test_cache_spans_decorator[True]
    • File: tests.integrations.django.test_cache_module
  • test_segment_span_has_profiler_id
    • File: tests.tracing.test_span_streaming

All tests are passing successfully.

✅ Patch coverage is 100.00% (no changed executable lines found; target 80%).
Project statement coverage is 90.34%.

Files with missing lines (1)
File Coverage % Lines
sentry_sdk/integrations/otlp.py 94.44% ⚠️ 7 Missing and 10 partials

Generated by Coverage Action

@sentrivana

Copy link
Copy Markdown
Collaborator

@sentry-junior Unstack this PR with major/3.0. They should be independent

@sentry-junior
sentry-junior Bot removed this pull request from stack #8202 November 6, 2026 09:50
Follow the sentry-ruby approach (getsentry/sentry-ruby#3063) and keep
setup_propagator as an opt-in instead of removing it.

Co-Authored-By: Ivana Kellyer <ivana.kellyer@sentry.io>
@sentry-junior
sentry-junior Bot force-pushed the ivana/otlp-remove-propagator branch from a3eef1a to 48a5db2 Compare November 6, 2026 10:02

This branch has not been deployed

No deployments
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.

Remove automatic propagator setup from OTLPIntegration

1 participant