Next Python SDK major - #5005
sentrivana wants to merge 320 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
|
Codecov Results 📊✅ 57379 passed | ❌ 2 failed | ⏭️ 2709 skipped | Total: 60090 | Pass Rate: 95.49% | Execution Time: 162m 42s 📊 Comparison with Base Branch
➕ New Tests (2)View new tests
❌ Failed Tests
|
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Anthropic
Documentation 📚
Internal Changes 🔧
Other
🤖 This preview updates automatically when you update the PR. |
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".
Use Hide whitespace ✨ Closes PY-2676 Closes #7072
…ion (#7180) Modify the LiteLLM integration to respect the data_collection config for controlling whether chat messages, embeddings inputs, and response text are captured in spans. When data collection is enabled, the new gen_ai.inputs and gen_ai.outputs flags control what data is collected. When data collection is not configured, falls back to legacy send_default_pii and include_prompts settings for compatibility. Refs PY-2588 Refs #6748
…7157) ### Description These tests are event-only: they capture events, never spans, and the `span_streaming` argument was only ever fed to `trace_lifecycle`. Both arms exercised identical code paths and asserted identical payloads, so the parametrize doubled the case count without adding coverage. Tests that inspect spans or transactions keep their parametrize. 391 -> 356 cases. Refs PY-2641 Refs #6975
…ption (#7175) Modify the LangGraph integration to respect the data_collection config for controlling whether prompts, responses, tool calls, and available tools are captured in spans. When data collection is enabled, the gen_ai.inputs flag controls request messages, tool calls, and available tools, while gen_ai.outputs controls the response text. Tool calls are gated on inputs because they are fed back to the model as input. Available tools are only gated once data collection is configured, since they were never gated on the legacy PII settings. When data collection is not configured, falls back to legacy send_default_pii and include_prompts settings for compatibility. Refs #6748 <br>Refs #6748
…ntrols (#7181) Replace the single \_should_send_prompts check with \_should_send_inputs and \_should_send_outputs, gated by the new data_collection.gen_ai.inputs/outputs experimental options when set, falling back to the existing send_default_pii * include_prompts behavior otherwise. Available tools are now gated on inputs specifically. This lets callers control request and response data collection independently. Refs PY-2588 Refs #6748
Quart 0.22.0 [reverts](pallets/quart@7337e5f) a change that landed in 0.21.0. Adapt our test accordingly.
…lection is enabled (#7204) When `data_collection` is configured, tool definitions should be set on `GEN_AI_TOOL_DEFINITIONS` instead of the legacy `GEN_AI_REQUEST_AVAILABLE_TOOLS` attribute, matching the updated gen-ai semantic conventions. The legacy attribute is still used when `data_collection` is not configured. Also gate the response tool calls recorded in `on_llm_end` on the `outputs` setting rather than `inputs`, since they are part of the model's response. Refs PY-2734 Refs #7200
### 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 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
Remove `send_default_pii` branches from the integration.
Add the `data_collection` option to all tests for the integration, with `gen_ai` options enabled if `send_default_pii=True` previously, and `gen_ai` options disabled if `send_default_pii=False` previously.
When `send_default_pii` was not previously supplied to `sentry_init()`, provide `data_collection={}`.
Split tests that were parametrized on `send_default_pii` into two tests with `gen_ai` options enabled and disabled (the latter suffixed with `_no_sensitive_data`).
Remove data-collection-specific tests, as existing tests now exercise the same code paths.
Closes #7602
Remove `send_default_pii` branches from the integration.
Add the `data_collection` option to all tests for the integration, with `gen_ai` options enabled if `send_default_pii=True` previously, and `gen_ai` options disabled if `send_default_pii=False` previously.
When `send_default_pii` was not previously supplied to `sentry_init()`, provide `data_collection={}`.
Split tests that were parametrized on `send_default_pii` into two tests with `gen_ai` options enabled and disabled (the latter suffixed with `_no_sensitive_data`).
Remove data-collection-specific tests, as existing tests now exercise the same code paths.
Closes #7587
Remove `send_default_pii` branches from the integration.
Add the `data_collection` option to all tests for the integration, with `gen_ai` options enabled if `send_default_pii=True` previously, and `gen_ai` options disabled if `send_default_pii=False` previously.
When `send_default_pii` was not previously supplied to `sentry_init()`, provide `data_collection={}`.
Split tests that were parametrized on `send_default_pii` into two tests with `gen_ai` options enabled and disabled (the latter suffixed with `_no_sensitive_data`).
Remove cases of `_data_collection`-suffixed tests that are now exercised by existing tests.
Closes #7596
Remove `send_default_pii` branches from the integration.
Add the `data_collection` option to all tests for the integration, with `gen_ai` options enabled if `send_default_pii=True` previously, and `gen_ai` options disabled if `send_default_pii=False` previously.
When `send_default_pii` was not previously supplied to `sentry_init()`, provide `data_collection={}`.
Split tests that were parametrized on `send_default_pii` into two tests with `gen_ai` options enabled and disabled (the latter suffixed with `_no_sensitive_data`).
Remove cases of `_data_collection`-suffixed tests that are now exercised by existing tests.
Closes #7598
Remove `send_default_pii` branches from the integration.
Add the `data_collection` option to all tests for the integration, with `gen_ai` options enabled if `send_default_pii=True` previously, and `gen_ai` options disabled if `send_default_pii=False` previously.
When `send_default_pii` was not previously supplied to `sentry_init()`, provide `data_collection={}`.
Split tests that were parametrized on `send_default_pii` into two tests with `gen_ai` options enabled and disabled (the latter suffixed with `_no_sensitive_data`).
Remove cases of `_data_collection`-suffixed tests that are now exercised by existing tests.
Closes #7597
Remove `send_default_pii` branches from the integration.
Add the `data_collection` option to all tests for the integration, with `gen_ai` options enabled if `send_default_pii=True` previously, and `gen_ai` options disabled if `send_default_pii=False` previously.
When `send_default_pii` was not previously supplied to `sentry_init()`, provide `data_collection={}`.
Split tests that were parametrized on `send_default_pii` into two tests with `gen_ai` options enabled and disabled (the latter suffixed with `_no_sensitive_data`).
Remove cases of `_data_collection`-suffixed tests that are now exercised by existing tests.
Closes #7592
Remove `send_default_pii` branches from the integration.
Add the `data_collection` option to all tests for the integration, with `gen_ai` options enabled if `send_default_pii=True` previously, and `gen_ai` options disabled if `send_default_pii=False` previously.
When `send_default_pii` was not previously supplied to `sentry_init()`, provide `data_collection={}`.
Split tests that were parametrized on `send_default_pii` into two tests with `gen_ai` options enabled and disabled (the latter suffixed with `_no_sensitive_data`).
Remove cases of `_data_collection`-suffixed tests that are now exercised by existing tests.
Closes #7588
The `data_collection` option now fully governs user info, query string, and header capture in the Quart integration; `send_default_pii` is no longer consulted. Consolidates and dedupes the corresponding tests around `data_collection` cases. Fixes PY-2836 Fixes #7607
Remove `send_default_pii` branches from the integration.
Add the `data_collection` option to all tests for the integration, with `gen_ai` options enabled if `send_default_pii=True` previously, and `gen_ai` options disabled if `send_default_pii=False` previously.
When `send_default_pii` was not previously supplied to `sentry_init()`, provide `data_collection={}`.
Split tests that were parametrized on `send_default_pii` into two tests with `gen_ai` options enabled and disabled (the latter suffixed with `_no_sensitive_data`).
Remove cases of `_data_collection`-suffixed tests that are now exercised by existing tests.
Closes #7595
Remove `send_default_pii` branches from the integration.
Add the `data_collection` option to all tests for the integration, with `gen_ai` options enabled if `send_default_pii=True` previously, and `gen_ai` options disabled if `send_default_pii=False` previously.
When `send_default_pii` was not previously supplied to `sentry_init()`, provide `data_collection={}`.
Split tests that were parametrized on `send_default_pii` into two tests with `gen_ai` options enabled and disabled (the latter suffixed with `_no_sensitive_data`).
Remove data-collection-specific tests, as existing tests now exercise the same code paths.
Closes #7603
Remove `send_default_pii` branches from the integration.
Add the `data_collection` option to all tests for the integration, with `gen_ai` options enabled if `send_default_pii=True` previously, and `gen_ai` options disabled if `send_default_pii=False` previously.
When `send_default_pii` was not previously supplied to `sentry_init()`, provide `data_collection={}`.
Split tests that were parametrized on `send_default_pii` into two tests with `gen_ai` options enabled and disabled (the latter suffixed with `_no_sensitive_data`).
Remove data-collection-specific tests, as existing tests now exercise the same code paths.
Closes #7604
Remove `send_default_pii` branches from the integration.
Add the `data_collection` option to all tests for the integration, with `gen_ai` options enabled if `send_default_pii=True` previously, and `gen_ai` options disabled if `send_default_pii=False` previously.
When `send_default_pii` was not previously supplied to `sentry_init()`, provide `data_collection={}`.
Split tests that were parametrized on `send_default_pii` into two tests with `gen_ai` options enabled and disabled (the latter suffixed with `_no_sensitive_data`).
Remove data-collection-specific tests, as existing tests now exercise the same code paths.
Closes #7600
…filter_headers (#7737) _filter_headers now always uses the data_collection configuration for request header filtering, removing the legacy send_default_pii fallback path and the now-unused use_annotated_value parameter. Updates all call sites across aiohttp, aws_lambda, chalice, gcp, quart, sanic, tornado, wsgi, and _asgi_common accordingly, and removes tests covering the removed legacy behaviour. Refs PY-2853 Refs #7646
Always derive request cookies and body collection from `data_collection`
instead of falling back to `send_default_pii` when it isn't configured.
Remove the Django cookie-scrubbing tests that depended on
`send_default_pii`, and switch the remaining Django tests to
`data_collection={}`
Refs PY-2798
Refs #7566
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
SDK3.0 label on GitHub so that you can follow along.Notable changes
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-basebranch, 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.