Skip to content

Next Python SDK major - #5005

Draft
sentrivana wants to merge 303 commits into
masterfrom
major/3.0
Draft

sentrivana wants to merge 303 commits into
masterfrom
major/3.0

Conversation

@sentrivana

@sentrivana sentrivana commented Oct 24, 2025 •

Copy link
Copy Markdown
Contributor

We're preparing our next major on this branch.

The project is tracked in Linear. If you don't have access, we'll try to tag issues belonging to the project with the SDK 3.0 label on GitHub so that you can follow along.

Notable changes

  • Transaction-based tracing will be removed. Span streaming will be the default tracing model.
  • Python 3.6 support will be removed.

Context

You might have read this announcement about us discontinuing work on a 3.0. This is referring to the work done on the potel-base branch, which included two types of changes: a huge refactor of our tracing code on the one hand, and various unrelated changes, improvements and fixes on the other. We're dropping the huge refactor part, and only porting the rest, to a new branch and eventually a new 3.0 release.

@codecov

codecov Bot commented Oct 24, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.76%. Comparing base (14aff96) to head (d864ba0).
⚠️ Report is 4 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #5005       +/-   ##
===========================================
+ Coverage   70.55%   83.76%   +13.21%     
===========================================
  Files         180      180               
  Lines       18077    18080        +3     
  Branches     3008     3009        +1     
===========================================
+ Hits        12754    15145     +2391     
+ Misses       4432     1943     -2489     
- Partials      891      992      +101     
Files with missing lines Coverage Δ
sentry_sdk/integrations/__init__.py 88.42% <100.00%> (+0.37%) ⬆️

... and 61 files with indirect coverage changes

@github-actions

github-actions Bot commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ 62139 passed | ❌ 2 failed | ⏭️ 2886 skipped | Total: 65027 | Pass Rate: 95.56% | Execution Time: 177m 23s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -72027
Passed Tests 📉 -67763
Failed Tests 📈 +2
Skipped Tests 📉 -4266

➕ New Tests (2)

View new tests
  • test_db_transaction_spans_disabled_atomic
    • File: tests.integrations.django.test_db_transactions
    • Status: ❌ Failing
  • test_input_attributes_nonstreaming_chat[True-messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
    • Status: ❌ Failing

❌ Failed Tests

test_db_transaction_spans_disabled_atomic

File: tests.integrations.django.test_db_transactions
Suite: py3.10-django-v5.2.17
Error: tests/integrations/django/test_db_transactions.py:263: in test_db_transaction_spans_disabled_atomic assert postgres_commit["is_segment"] is True E assert False is True

Stack Trace
tests/integrations/django/test_db_transactions.py:263: in test_db_transaction_spans_disabled_atomic
    assert postgres_commit["is_segment"] is True
E   assert False is True

test_input_attributes_nonstreaming_chat[True-messages0-expected_system_instructions0-expected_input_messages0]

File: tests.integrations.mistral.test_mistral
Suite: py3.10-mistral-v2.0.5
Error: KeyError: 140682961752512

Stack Trace
tests/integrations/mistral/test_mistral.py:380: in test_input_attributes_nonstreaming_chat
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
sentry_sdk/client.py:278: in __init__
    self._init_impl()
sentry_sdk/client.py:428: in _init_impl
    self.integrations = setup_integrations(
sentry_sdk/integrations/__init__.py:216: in setup_integrations
    for integration_cls in iter_default_integrations(
sentry_sdk/integrations/__init__.py:44: in iter_default_integrations
    yield getattr(import_module(module), cls)
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1024: in _find_and_load
    ???
<frozen importlib._bootstrap>:171: in __enter__
    ???
<frozen importlib._bootstrap>:123: in acquire
    ???
E   KeyError: 140682961752512

✅ Patch coverage is 90.13%. Project has 2068 uncovered lines.
❌ Project coverage is 90.13%. Comparing base (b499d89) to head (5d125bf).

Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.23%    90.13%     -0.1%
==========================================
  Files          194       178       -16
  Lines        26030     20960     -5070
  Branches      9678      7534     -2144
==========================================
+ Hits         23487     18892     -4595
- Misses        2543      2068      -475
- Partials      1454      1193      -261

Generated by Codecov Action

@github-actions

github-actions Bot commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

⚪ None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (logging) Separate ignore lists for events/breadcrumbs and sentry logs by sl0thentr0py in #5698

Bug Fixes 🐛

Anthropic

  • Set exception info on streaming span when applicable by alexander-alderman-webb in #5683
  • Patch AsyncStream.close() and AsyncMessageStream.close() to finish spans by alexander-alderman-webb in #5675
  • Patch Stream.close() and MessageStream.close() to finish spans by alexander-alderman-webb in #5674

Documentation 📚

  • Add note on AI PRs to CONTRIBUTING.md by sentrivana in #5696

Internal Changes 🔧

  • Add -latest alias for each integration test suite by sentrivana in #5706
  • Use date-based branch names for toxgen PRs by sentrivana in #5704
  • 🤖 Update test matrix with new releases (03/19) by github-actions in #5703
  • Add client report tests for span streaming by sentrivana in #5677

Other

  • Next Python SDK major by sentrivana in #5005
  • Update CHANGELOG.md by sentrivana in #5685

🤖 This preview updates automatically when you update the PR.

Comment thread sentry_sdk/consts.py
Comment thread sentry_sdk/integrations/otlp.py
Comment thread tests/integrations/django/asgi/test_asgi.py
Comment thread sentry_sdk/integrations/otlp.py
Comment thread tests/integrations/threading/test_threading.py Outdated
Comment thread sentry_sdk/integrations/launchdarkly.py Outdated
Comment thread sentry_sdk/scope.py Outdated
Comment thread sentry_sdk/integrations/trytond.py
Comment thread sentry_sdk/integrations/chalice.py
Comment thread sentry_sdk/integrations/openai_agents/__init__.py
Comment thread sentry_sdk/integrations/pydantic_ai/__init__.py
Comment thread sentry_sdk/integrations/spark/spark_driver.py
Comment thread tests/integrations/launchdarkly/test_launchdarkly.py
Comment thread sentry_sdk/integrations/__init__.py Outdated
Comment thread sentry_sdk/integrations/openai_agents/__init__.py
Comment thread sentry_sdk/integrations/starlette.py
sentrivana added a commit that referenced this pull request Aug 6, 2026
Fixes for things that the bots
[surfaced](#5005) on the
major branch:
- some version checks were too late (after patching)
- fix TrytondWSGI integration name/`_MIN_VERSIONS` entry mismatch

Also, changed the warning of the `DidNotEnable` message from "X not
installed" to "X not installed or incompatible".
### Description
- drop experimental options if they have a top-level replacement
- remove `start_profile_session` and `stop_profile_session` (replaced by
`start_profile` and `stop_profile`)


There is a `continuous_profiling_auto_start` experimental option without
a top-level replacement. There's also a
`try_autostart_continuous_profiler` function that says it should be
deprecated in favor of "auto lifecycle". There is no auto lifecycle as
far as I can tell. Or is this referring to `lifecycle=trace`? Leaving
this as is for now...

#### Issues
Closes #6946
- Remove `skipif`s that are not necessary anymore (because they skip
running the test case against framework versions we've now dropped)
- Remove flaky skipped threading test
Comment thread sentry_sdk/integrations/redis/modules/queries.py
Comment thread sentry_sdk/integrations/langchain.py
Comment thread sentry_sdk/spotlight.py
Comment thread sentry_sdk/spotlight.py
There were some tests that were not fully migrated to span streaming
yet, so I adapted them.

Closes #7119
### Description
Hide whitespace for a much easier time reviewing

#### Issues
Closes PY-2722
Closes #7118
The parameter allowed users to opt out of collecting GenAI attributes while keeping `send_default_pii=True`.
It is ignored when data collection is used, and the major release drops `send_default_pii` in favor of data collection.
The parameter allowed users to opt out of collecting GenAI attributes while keeping `send_default_pii=True`.
It is ignored when data collection is used, and the major release drops `send_default_pii` in favor of data collection.
The parameter allowed users to opt out of collecting GenAI attributes while keeping `send_default_pii=True`.
It is ignored when data collection is used, and the major release drops `send_default_pii` in favor of data collection.
…ent spans (#7521)

Remove the response streaming flag from Invoke Agent spans because it is ambiguous for an agent that makes multiple model calls in the course of its execution.
Each model call may be synchronous or streamed, independently.
There is no need for agents to be under a common parent in span-first, since agents that hand off to each other share the same trace ID in the streaming trace lifecycle (sibling agent invocation spans).
### Description
- remove `send_default_pii` branching in `tests_s3.py`.
- Remove `send_default_pii` fallback from
`tracing_utils.get_url_attributes()`

#### Issues
Resolves #7658
Comment thread sentry_sdk/integrations/aws_lambda.py
sentrivana and others added 22 commits September 24, 2026 09:47
### Description
- remove `send_default_pii` parametrization cases from
`DATA_COLLECTION_USER_INFO_CASES`.
- update comments.
Port of #4164

See #3913 for an
example of an exception chain that is currently not working properly.

Closes
https://linear.app/getsentry/issue/PY-1948/better-handling-of-exception-groups

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
If `before_breadcrumb`, an event processor, or an error processor raises
an exception, the associated breadcrumb or event should be discarded as
per spec.

Change goes into new major since it's breaking.
### Description
- `PyramidRequestExtractor` inherits from `RequestExtractor` which still
has some `send_default_pii` branching, but this will be fixed in #7616.

#### Issues
Resolves #7606
### Description
- `PyramidRequestExtractor` inherits from `RequestExtractor` which still
has some `send_default_pii` branching, but this will be fixed in #7616;
same for `SentryWsgiMiddleware`.

#### Issues
Resolves #7650
### Description
- drop `send_default_pii` support from Starlette integration.

#### Issues
Resolves #7612
### Description
- drop `send_default_pii` support for Pymongo integration.

#### Issues
Resolves #7605
### Description

* `SanicRequestExtractor` inherits from `RequestExtractor` which still
has some `send_default_pii` branching, but this will be fixed in #7616.

#### Issues

Resolves #7611
### Description
- `TornadoRequestExtractor` inherits from `RequestExtractor` which still
has some `send_default_pii` branching, but this will be fixed in #7616.

#### Issues
Resolves #7615
### Description
- `request_body_within_bounds()` still has some `send_default_pii`
branching, but this will be fixed in #7616.

#### Issues
Resolves #7726
### Description
Remove `send_default_pii` support from Huey integration.

#### Issues
Resolves #7594
### Description
Drop `send_default_pii` support for RQ integration.

#### Issues
Resolves #7609
### Description
Drop `send_default_pii` support from Starlite integration.

#### Issues
Resolves #7613
### Description
Drop `send_default_pii` support from Litestar integration.

#### Issues
Resolves #7599

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants