Skip to content

Next Python SDK major - #5005

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

sentrivana wants to merge 290 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 📊

62922 passed | ❌ 2 failed | ⏭️ 2890 skipped | Total: 65814 | Pass Rate: 95.61% | Execution Time: 178m 51s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -71240
Passed Tests 📉 -66980
Failed Tests 📈 +2
Skipped Tests 📉 -4262

➕ New Tests (1)

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

❌ Failed Tests

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: 139937512624128

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: 139937512624128

✅ Patch coverage is 90.12%. Project has 2074 uncovered lines.
❌ Project coverage is 90.12%. Comparing base (b499d89) to head (41bc733).

Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.20%    90.12%    -0.08%
==========================================
  Files          194       178       -16
  Lines        26030     20998     -5032
  Branches      9678      7574     -2104
==========================================
+ Hits         23480     18924     -4556
- Misses        2550      2074      -476
- Partials      1454      1196      -258

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
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".
Strawberry is not auto-enabling in 3.0 anymore, so this guard is not
necessary.
### Description
Remove the `@ai_track` decorator and associated tests

#### Issues
Part of #6894
### Description
The actual compat code was removed with the contextvars shim. Just test
utils remain.

#### Issues
Closes #4997
Drop support for redis-py<[4.2](https://pypi.org/project/redis/4.2.0/):
- remove redis cluster legacy (it was moved directly into redis-py in
4.1)
- remove deprecated `max_data_size` integration option
- remove conditional patching of async client and pipeline -- just patch
always (they're available from 4.2+)
- use the Redis class instead of StrictRedis (which is just an alias)
sentrivana and others added 20 commits September 23, 2026 13:36
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.
### Description
- drop `send_default_pii` support from aws-lambda integration.
- explicitly use `data_collection: {}` in `sentry_init(...)` to fallback
to default config.

#### Issues
Resolves #7585
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.
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.
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 9 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

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