Skip to content

Cap sentry-sdk below 3 and remove the 3.x code paths - #379

Merged
lesnik512 merged 1 commit into
mainfrom
sentry-sdk-2-only
Oct 29, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
sentry-sdk-2-only

Conversation

@lesnik512

@lesnik512 lesnik512 commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

The sentry extra is now sentry-sdk>=2.70,<3, down from <4. The 3.x code paths from #359 are removed, so 2.0 supports one sentry-sdk major and can ship before sentry-sdk 3.0 reaches GA. 3.x support was only ever tested against betas, and the betas were still changing. b2 kept trace_lifecycle, which b1's migration guide listed as removed, and it removed enable_metrics, stream_gen_ai_spans and trace_ignore_status_codes.

The floor stays at 2.70, because SentryInstrument still passes the top-level data_collection option. The explicit DEFAULT_DATA_COLLECTION and the tests #359 rewrote to assert behaviour stay as well. They don't depend on the major.

Code

  • sentry_instrument.py drops IS_SENTRY_SDK_2.
    • _build_integrations always builds LoggingIntegration(level=sentry_logging_breadcrumb_level, sentry_logs_level=None).
    • capture_request_exception always passes client_options to event_from_exception.
  • litestar_bootstrapper.py calls sentry_logging.ignore_logger("litestar") directly. The ignore_logger_for_events fallback for 3.x is gone.
  • benchmarks/micro.py and benchmarks/repro_sentry_txn.py are back to their state before feat(sentry)!: support sentry-sdk 3 alongside 2.x and raise the floor to 2.70 #359. Nothing has changed them since.
  • benchmarks/sentry_scenarios.py loses its major checks. The Transaction patches and errors_only_txn_endpoint_style are unconditional again, and so are the direct ty: ignore assignments.

CI

The sentry-majors job is removed. Its sentry-sdk<3 leg is what the pytest jobs resolve now, and its 3.0.0b2 leg tested a major that is no longer allowed.

Docs

  • configuration.md: "Sentry logging integration" describes the single 2.x call and says 3.0 isn't supported yet. "Sentry data collection" loses the 3.x paragraph, and the auto-enabling section loses the 3.0.0b2 Redis number.
  • fastapi.md, litestar.md and fastmcp.md lose the 3.0.0b2 column from their Sentry cost tables. litestar.md also loses the sentence about sampled sentry-trace headers on 3.0.
  • benchmarks/README.md says the scripts run on 2.x only. Its measurement tables keep their 3.0.0b2 columns as a record of what was measured.

Tests

The suite passes, 591 tests at 100% coverage (just test-ci) on sentry-sdk 2.73.0. just lint (including ty), just adr-check and just docs-build pass too. No new test: on 2.x the behaviour is unchanged, and the removed branches only ran on 3.x. All sentry_scenarios.py scenarios build, and micro.py runs. No floor changes.

Breaking changes

None against 1.x, which caps sentry-sdk below 3 as well (#327). Against the unreleased 2.0 main, sentry-sdk 3.x can no longer be installed alongside lite-bootstrap.

Follow-up: #380 brings 3.x support back once 3.0 is GA.

@lesnik512 lesnik512 added this to the 2.0.0 milestone Oct 29, 2026
@lesnik512
lesnik512 merged commit bab41ae into main Oct 29, 2026
35 checks passed
@lesnik512
lesnik512 deleted the sentry-sdk-2-only branch October 29, 2026 19:17
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.

1 participant