Next Python SDK major - #5005
Draft
sentrivana wants to merge 143 commits into
Draft
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
|
Closed
Contributor
Codecov Results 📊✅ 107526 passed | ⏭️ 5338 skipped | Total: 112864 | Pass Rate: 95.27% | Execution Time: 354m 50s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 90.49%. Project has 2251 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 90.27% 90.49% +0.22%
==========================================
Files 193 185 -8
Lines 25612 23658 -1954
Branches 9446 8712 -734
==========================================
+ Hits 23120 21407 -1713
- Misses 2492 2251 -241
- Partials 1435 1369 -66Generated by Codecov Action |
Contributor
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. |
Add `UnraisablehookIntegration` to the default integrations list.
Stop raising exceptions `from None` in the ASGI and asyncio integrations. Closes #5624
Remove everything hub related, including all sorts of compatibility shims around hubs/scopes. Also remove deprecated session methods. `configure_scope` and `push_scope` removal coming in a future PR. #### Issues Closes #5001
The integration requires additional configuration which should be intentional on the user's part. #### Issues Closes #4993
- Remove everything in `integrations/opentelemetry` (`SentrySpanProcessor`, `SentryPropagator`, etc.) - Remove associated test files and CI config - Move old propagator functions and consts that we were using in `OTLPIntegration` to the OTLP propagator directly - Remove `instrumenter` Note: `NoOpSpan` was not removed because it makes mypy blow up. Not worth the effort as we'll anyway get rid of it when dropping transaction based tracing. #### Issues Closes #6932
### Description The API is deprecated and slated for removal in 3.0. #### Issues Closes #5019 #### Reminders - Please add tests to validate your changes, and lint your code using `uv run ruff`. - Add GH Issue ID _&_ Linear ID (if applicable) - PR title should use [conventional commit](https://develop.sentry.dev/engineering-practices/commit-messages/#type) style (`feat:`, `fix:`, `ref:`, `meta:`) - For external contributors: [CONTRIBUTING.md](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md), [Sentry SDK development docs](https://develop.sentry.dev/sdk/), [Discord community](https://discord.gg/Ww9hbqr)
### Description Remove the deprecated API. #### Issues Closes #5018
### Description Most of the entries in our extras list serve as a way to communicate/enforce the lower boundary of the respective framework that we support. This creates a parallel system to the version checks we already have in each integration. Some extras, however, define extra dependencies or specific extras that are required for an integration to work correctly (e.g. the Flask integration needs `blinker` to work properly). In that case, keep the extra. #### Issues Closes #6259
### Description Getting rid of custom APIs. `update_current_span` never worked with span streaming anyway. #### Issues Part of https://linear.app/getsentry/issue/PY-2623/drop-custom-apis Part of #6894 #### Reminders - Please add tests to validate your changes, and lint your code using `uv run ruff`. - Add GH Issue ID _&_ Linear ID (if applicable) - PR title should use [conventional commit](https://develop.sentry.dev/engineering-practices/commit-messages/#type) style (`feat:`, `fix:`, `ref:`, `meta:`) - For external contributors: [CONTRIBUTING.md](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md), [Sentry SDK development docs](https://develop.sentry.dev/sdk/), [Discord community](https://discord.gg/Ww9hbqr)
### Description Many of the `set_tag` calls were only present in non-span-streaming branches, which will be completely removed anyway, and we've already migrated those tags, if applicable, to span attributes in the scope of span first. #### Issues Closes https://linear.app/getsentry/issue/PY-1940/remove-tags-auto-set-by-the-sdk
### Description Get the logging integration into shape now that Sentry Logs is a first-class feature. The idea is to make Logs the primary feature the integration offers, with capturing events an optional add-on. High-level overview of the changes: - The integration has to be **enabled explicitly** by the user. It's not auto-enabled anymore. - **Sentry logs related options and features get more generic sounding names**. - For instance, `level` (before: `sentry_logs_level`), `ignore_logger` (before: `ignore_logger_for_sentry_logs`) now set the Sentry logs level and Sentry logs denylist, respectively. - Existing secondary features with previously generic names get specialized names (`level` -> `breadcrumb_level`, `ignore_logger` -> `ignore_logger_for_events`). - **Capturing Sentry logs is on by default** when the integration is enabled. - **Event capture is off by default**, but can be turned on via an option. Breadcrumb capture is still on by default. - The **`capture_sentry_logs` option is gone completely**. Since logs instrumentation is now on by default, and the `level` option exists, it was superfluous. Capturing logs can still be opted out of by setting `level=None`. Collateral: - Updated unrelated tests that were implicitly relying on default behavior of the logging integration #### Issues Closes #7246 Closes https://linear.app/getsentry/issue/PY-2739/update-logging-integration
### Description Get the Loguru integration into shape now that Sentry Logs is a first-class feature. The idea is to make Logs the primary feature the integration offers, with capturing events an optional add-on. High-level overview of the changes: - The integration has to be **enabled explicitly** by the user. It's not auto-enabled anymore. - **Sentry logs related options and features get more generic sounding names**. - For instance, `level` (before: `sentry_logs_level`) now sets the Sentry logs level. - Existing secondary features with previously generic names get specialized names (`level` -> `breadcrumb_level`). - **Capturing Sentry logs is on by default** when the integration is enabled. - **Event capture is off by default**, but can be turned on via an option. Breadcrumb capture is still on by default. - The **`capture_sentry_logs` option is gone completely**. Since logs instrumentation is now on by default, and the `level` option exists, it was superfluous. Capturing logs can still be opted out of by setting `level=None`. #### Issues Closes #7247 Closes https://linear.app/getsentry/issue/PY-2740/update-loguru-integration
Changes: - remove deprecated `max_spans` option of `LangchainIntegration` - remove deprecated `sentry_sdk.init()` context manager - remove deprecated `configure_debug_hub` - remove deprecated `Baggage.from_options()` - remove deprecated `Transport.capture_event()` - remove deprecated `FunctionTransport` - the `Scope.trace_propagation_meta` function no longer accepts a `span` as argument - remove deprecated direct assignment to `Scope.level` - remove deprecated direct assignment to `Scope.user` - remove deprecated `Scope.iter_headers` Closes https://linear.app/getsentry/issue/PY-1935/drop-deprecated-stuff
…ng` for everything else) (#7268) - Add a helper to use for deprecation warnings, specifically, that uses `warnings.warn()` - For everything but deprecation warnings, use `logger.warning()` Closes https://linear.app/getsentry/issue/PY-1934/use-warningswarn-for-deprecations-and-loggerwarning-for-everything
This should not be needed anymore.
Includes a small hack to make the tests pass until `record_sql_queries` drops transaction support in a later PR: https://github.com/getsentry/sentry-python/pull/7190/changes#r3879480876 Closes PY-2689 Closes #7085
### Description Removed a handful of experimental options. Most of them now have a top-level counterpart. I left some still in: - `record_sql_queries`: This should probably be removed once data collection is out out. - `trace_lifecycle`: I'd remove this when we remove the top-level `trace_lifecycle` at a later point. - transport options: keeping these for now - continuous profiler start: no top-level counterpart #### Issues Closes https://linear.app/getsentry/issue/PY-1924/remove-experimental-options
While the Flask integration itself doesn't differentiate if span streaming is enabled or not, the tests do.
Remove transaction tests from some test suites where the integration itself doesn't have transaction code (anymore). These are: - feature flag integrations - Tornado - probably because of an automatic merge of master to the major branch, new instances of two tests were introduced that only differ from existing tests by name (`test_request_body_data_collection_span_streaming`, `test_oversized_request_body_not_annotated_data_collection_span_streaming`) -- removed those - stdlib (http) -> just a rename
### Description I removed the transaction-based tracing fallback from the Huey integration - I did this by doing the following: - Removed all has_span_streaming_enabled branching and enforced the use of sentry_sdk.traces.start_span for both patch_enqueue and patch_execute - Removed legacy compatibility utilities like the else: fallback blocks and the legacy continue_trace/set_status calls on scope.transaction - Deleted transaction-based tests (like the has_span_streaming parameterization) and updated the remaining test suite to unconditionally validate span streaming payloads instead of legacy transactions #### Issues * resolves: #7095 #### Reminders - Please add tests to validate your changes, and lint your code using `uv run ruff`. - Add GH Issue ID _&_ Linear ID (if applicable) - PR title should use [conventional commit](https://develop.sentry.dev/engineering-practices/commit-messages/#type) style (`feat:`, `fix:`, `ref:`, `meta:`) - For external contributors: [CONTRIBUTING.md](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md), [Sentry SDK development docs](https://develop.sentry.dev/sdk/), [Discord community](https://discord.gg/Ww9hbqr)
Looks like the asgi integration itself doesn't have any span streaming branching, only the tests do. Closes https://linear.app/getsentry/issue/PY-2679/remove-transaction-based-tracing-from-asgi
Probably got in with a recent master -> major merge.
### Description Use ✨ Hide whitespace ✨ CI needs this to pass: - #7312 #### Issues Closes https://linear.app/getsentry/issue/PY-2724/remove-transaction-based-tracing-from-wsgi #### Reminders - Please add tests to validate your changes, and lint your code using `uv run ruff`. - Add GH Issue ID _&_ Linear ID (if applicable) - PR title should use [conventional commit](https://develop.sentry.dev/engineering-practices/commit-messages/#type) style (`feat:`, `fix:`, `ref:`, `meta:`) - For external contributors: [CONTRIBUTING.md](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md), [Sentry SDK development docs](https://develop.sentry.dev/sdk/), [Discord community](https://discord.gg/Ww9hbqr)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.