getsentry/sentry-python (sentry-sdk)
### [`v2.19.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2190)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.18.0...2.19.0)
##### Various fixes & improvements
- New: introduce `rust_tracing` integration. See https://docs.sentry.io/platforms/python/integrations/rust_tracing/ ([#3717](https://redirect.github.com/getsentry/sentry-python/issues/3717)) by [@matt-codecov](https://redirect.github.com/matt-codecov)
- Auto enable Litestar integration ([#3540](https://redirect.github.com/getsentry/sentry-python/issues/3540)) by [@provinzkraut](https://redirect.github.com/provinzkraut)
- Deprecate `sentry_sdk.init` context manager ([#3729](https://redirect.github.com/getsentry/sentry-python/issues/3729)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- feat(spotlight): Send PII to Spotlight when no DSN is set ([#3804](https://redirect.github.com/getsentry/sentry-python/issues/3804)) by [@BYK](https://redirect.github.com/BYK)
- feat(spotlight): Add info logs when Sentry is enabled ([#3735](https://redirect.github.com/getsentry/sentry-python/issues/3735)) by [@BYK](https://redirect.github.com/BYK)
- feat(spotlight): Inject Spotlight button on Django ([#3751](https://redirect.github.com/getsentry/sentry-python/issues/3751)) by [@BYK](https://redirect.github.com/BYK)
- feat(spotlight): Auto enable cache_spans for Spotlight on DEBUG ([#3791](https://redirect.github.com/getsentry/sentry-python/issues/3791)) by [@BYK](https://redirect.github.com/BYK)
- fix(logging): Handle parameter `stack_info` for the `LoggingIntegration` ([#3745](https://redirect.github.com/getsentry/sentry-python/issues/3745)) by [@gmcrocetti](https://redirect.github.com/gmcrocetti)
- fix(pure-eval): Make sentry-sdk\[pure-eval] installable with pip==24.0 ([#3757](https://redirect.github.com/getsentry/sentry-python/issues/3757)) by [@sentrivana](https://redirect.github.com/sentrivana)
- fix(rust_tracing): include_tracing_fields arg to control unvetted data in rust_tracing integration ([#3780](https://redirect.github.com/getsentry/sentry-python/issues/3780)) by [@matt-codecov](https://redirect.github.com/matt-codecov)
- fix(aws) Fix aws lambda tests (by reducing event size) ([#3770](https://redirect.github.com/getsentry/sentry-python/issues/3770)) by [@antonpirker](https://redirect.github.com/antonpirker)
- fix(arq): fix integration with Worker settings as a dict ([#3742](https://redirect.github.com/getsentry/sentry-python/issues/3742)) by [@saber-solooki](https://redirect.github.com/saber-solooki)
- fix(httpx): Prevent Sentry baggage duplication ([#3728](https://redirect.github.com/getsentry/sentry-python/issues/3728)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- fix(falcon): Don't exhaust request body stream ([#3768](https://redirect.github.com/getsentry/sentry-python/issues/3768)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- fix(integrations): Check `retries_left` before capturing exception ([#3803](https://redirect.github.com/getsentry/sentry-python/issues/3803)) by [@malkovro](https://redirect.github.com/malkovro)
- fix(openai): Use name instead of description ([#3807](https://redirect.github.com/getsentry/sentry-python/issues/3807)) by [@sourceful-rob](https://redirect.github.com/sourceful-rob)
- test(gcp): Only run GCP tests when they should ([#3721](https://redirect.github.com/getsentry/sentry-python/issues/3721)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- chore: Shorten CI workflow names ([#3805](https://redirect.github.com/getsentry/sentry-python/issues/3805)) by [@sentrivana](https://redirect.github.com/sentrivana)
- chore: Test with pyspark prerelease ([#3760](https://redirect.github.com/getsentry/sentry-python/issues/3760)) by [@sentrivana](https://redirect.github.com/sentrivana)
- build(deps): bump codecov/codecov-action from 4.6.0 to 5.0.2 ([#3792](https://redirect.github.com/getsentry/sentry-python/issues/3792)) by [@dependabot](https://redirect.github.com/dependabot)
- build(deps): bump actions/checkout from 4.2.1 to 4.2.2 ([#3691](https://redirect.github.com/getsentry/sentry-python/issues/3691)) by [@dependabot](https://redirect.github.com/dependabot)
### [`v2.18.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2180)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.17.0...2.18.0)
##### Various fixes & improvements
- Add LaunchDarkly and OpenFeature integration ([#3648](https://redirect.github.com/getsentry/sentry-python/issues/3648)) by [@cmanallen](https://redirect.github.com/cmanallen)
- Correct typo in a comment ([#3726](https://redirect.github.com/getsentry/sentry-python/issues/3726)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- End `http.client` span on timeout ([#3723](https://redirect.github.com/getsentry/sentry-python/issues/3723)) by [@Zylphrex](https://redirect.github.com/Zylphrex)
- Check for `h2` existence in HTTP/2 transport ([#3690](https://redirect.github.com/getsentry/sentry-python/issues/3690)) by [@BYK](https://redirect.github.com/BYK)
- Use `type()` instead when extracting frames ([#3716](https://redirect.github.com/getsentry/sentry-python/issues/3716)) by [@Zylphrex](https://redirect.github.com/Zylphrex)
- Prefer `python_multipart` import over `multipart` ([#3710](https://redirect.github.com/getsentry/sentry-python/issues/3710)) by [@musicinmybrain](https://redirect.github.com/musicinmybrain)
- Update active thread for asgi ([#3669](https://redirect.github.com/getsentry/sentry-python/issues/3669)) by [@Zylphrex](https://redirect.github.com/Zylphrex)
- Only enable HTTP2 when DSN is HTTPS ([#3678](https://redirect.github.com/getsentry/sentry-python/issues/3678)) by [@BYK](https://redirect.github.com/BYK)
- Prepare for upstream Strawberry extension removal ([#3649](https://redirect.github.com/getsentry/sentry-python/issues/3649)) by [@DoctorJohn](https://redirect.github.com/DoctorJohn)
- Enhance README with improved clarity and developer-friendly examples ([#3667](https://redirect.github.com/getsentry/sentry-python/issues/3667)) by [@UTSAVS26](https://redirect.github.com/UTSAVS26)
- Run license compliance action on all PRs ([#3699](https://redirect.github.com/getsentry/sentry-python/issues/3699)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Run CodeQL action on all PRs ([#3698](https://redirect.github.com/getsentry/sentry-python/issues/3698)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Fix UTC assuming test ([#3722](https://redirect.github.com/getsentry/sentry-python/issues/3722)) by [@BYK](https://redirect.github.com/BYK)
- Exclude fakeredis 2.26.0 on py3.6 and 3.7 ([#3695](https://redirect.github.com/getsentry/sentry-python/issues/3695)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Unpin `pytest` for `tornado-latest` tests ([#3714](https://redirect.github.com/getsentry/sentry-python/issues/3714)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Install `pytest-asyncio` for `redis` tests (Python 3.12-13) ([#3706](https://redirect.github.com/getsentry/sentry-python/issues/3706)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Clarify that only pinned tests are required ([#3713](https://redirect.github.com/getsentry/sentry-python/issues/3713)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Remove accidentally-committed print ([#3712](https://redirect.github.com/getsentry/sentry-python/issues/3712)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Disable broken RQ test in newly-released RQ 2.0 ([#3708](https://redirect.github.com/getsentry/sentry-python/issues/3708)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Unpin `pytest` for `celery` tests ([#3701](https://redirect.github.com/getsentry/sentry-python/issues/3701)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Unpin `pytest` on Python 3.8+ `gevent` tests ([#3700](https://redirect.github.com/getsentry/sentry-python/issues/3700)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Unpin `pytest` for Python 3.8+ `common` tests ([#3697](https://redirect.github.com/getsentry/sentry-python/issues/3697)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Remove `pytest` pin in `requirements-devenv.txt` ([#3696](https://redirect.github.com/getsentry/sentry-python/issues/3696)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Test with Falcon 4.0 ([#3684](https://redirect.github.com/getsentry/sentry-python/issues/3684)) by [@sentrivana](https://redirect.github.com/sentrivana)
### [`v2.17.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2170)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.16.0...2.17.0)
##### Various fixes & improvements
- Add support for async calls in Anthropic and OpenAI integration ([#3497](https://redirect.github.com/getsentry/sentry-python/issues/3497)) by [@vetyy](https://redirect.github.com/vetyy)
- Allow custom transaction names in ASGI ([#3664](https://redirect.github.com/getsentry/sentry-python/issues/3664)) by [@sl0thentr0py](https://redirect.github.com/sl0thentr0py)
- Langchain: Handle case when parent span wasn't traced ([#3656](https://redirect.github.com/getsentry/sentry-python/issues/3656)) by [@rbasoalto](https://redirect.github.com/rbasoalto)
- Fix Anthropic integration when using tool calls ([#3615](https://redirect.github.com/getsentry/sentry-python/issues/3615)) by [@kwnath](https://redirect.github.com/kwnath)
- More defensive Django Spotlight middleware injection ([#3665](https://redirect.github.com/getsentry/sentry-python/issues/3665)) by [@BYK](https://redirect.github.com/BYK)
- Remove `ensure_integration_enabled_async` ([#3632](https://redirect.github.com/getsentry/sentry-python/issues/3632)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Test with newer Falcon version ([#3644](https://redirect.github.com/getsentry/sentry-python/issues/3644), [#3653](https://redirect.github.com/getsentry/sentry-python/issues/3653), [#3662](https://redirect.github.com/getsentry/sentry-python/issues/3662)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Fix mypy ([#3657](https://redirect.github.com/getsentry/sentry-python/issues/3657)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Fix flaky transport test ([#3666](https://redirect.github.com/getsentry/sentry-python/issues/3666)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Remove pin on `sphinx` ([#3650](https://redirect.github.com/getsentry/sentry-python/issues/3650)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Bump `actions/checkout` from `4.2.0` to `4.2.1` ([#3651](https://redirect.github.com/getsentry/sentry-python/issues/3651)) by [@dependabot](https://redirect.github.com/dependabot)
### [`v2.16.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2160)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.15.0...2.16.0)
##### Integrations
- Bottle: Add `failed_request_status_codes` ([#3618](https://redirect.github.com/getsentry/sentry-python/issues/3618)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
You can now define a set of integers that will determine which status codes
should be reported to Sentry.
```python
sentry_sdk.init(
integrations=[
BottleIntegration(
failed_request_status_codes={403, *range(500, 600)},
)
]
)
```
Examples of valid `failed_request_status_codes`:
- `{500}` will only send events on HTTP 500.
- `{400, *range(500, 600)}` will send events on HTTP 400 as well as the 5xx range.
- `{500, 503}` will send events on HTTP 500 and 503.
- `set()` (the empty set) will not send events for any HTTP status code.
The default is `{*range(500, 600)}`, meaning that all 5xx status codes are reported to Sentry.
- Bottle: Delete never-reached code ([#3605](https://redirect.github.com/getsentry/sentry-python/issues/3605)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Redis: Remove flaky test ([#3626](https://redirect.github.com/getsentry/sentry-python/issues/3626)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Django: Improve getting `psycopg3` connection info ([#3580](https://redirect.github.com/getsentry/sentry-python/issues/3580)) by [@nijel](https://redirect.github.com/nijel)
- Django: Add `SpotlightMiddleware` when Spotlight is enabled ([#3600](https://redirect.github.com/getsentry/sentry-python/issues/3600)) by [@BYK](https://redirect.github.com/BYK)
- Django: Open relevant error when `SpotlightMiddleware` is on ([#3614](https://redirect.github.com/getsentry/sentry-python/issues/3614)) by [@BYK](https://redirect.github.com/BYK)
- Django: Support `http_methods_to_capture` in ASGI Django ([#3607](https://redirect.github.com/getsentry/sentry-python/issues/3607)) by [@sentrivana](https://redirect.github.com/sentrivana)
ASGI Django now also supports the `http_methods_to_capture` integration option. This is a configurable tuple of HTTP method verbs that should create a transaction in Sentry. The default is `("CONNECT", "DELETE", "GET", "PATCH", "POST", "PUT", "TRACE",)`. `OPTIONS` and `HEAD` are not included by default.
Here's how to use it:
```python
sentry_sdk.init(
integrations=[
DjangoIntegration(
http_methods_to_capture=("GET", "POST"),
),
],
)
```
##### Miscellaneous
- Add 3.13 to setup.py ([#3574](https://redirect.github.com/getsentry/sentry-python/issues/3574)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Add 3.13 to basepython ([#3589](https://redirect.github.com/getsentry/sentry-python/issues/3589)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Fix type of `sample_rate` in DSC (and add explanatory tests) ([#3603](https://redirect.github.com/getsentry/sentry-python/issues/3603)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Add `httpcore` based `HTTP2Transport` ([#3588](https://redirect.github.com/getsentry/sentry-python/issues/3588)) by [@BYK](https://redirect.github.com/BYK)
- Add opportunistic Brotli compression ([#3612](https://redirect.github.com/getsentry/sentry-python/issues/3612)) by [@BYK](https://redirect.github.com/BYK)
- Add `__notes__` support ([#3620](https://redirect.github.com/getsentry/sentry-python/issues/3620)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Remove useless makefile targets ([#3604](https://redirect.github.com/getsentry/sentry-python/issues/3604)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Simplify tox version spec ([#3609](https://redirect.github.com/getsentry/sentry-python/issues/3609)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Consolidate contributing docs ([#3606](https://redirect.github.com/getsentry/sentry-python/issues/3606)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Bump `codecov/codecov-action` from `4.5.0` to `4.6.0` ([#3617](https://redirect.github.com/getsentry/sentry-python/issues/3617)) by [@dependabot](https://redirect.github.com/dependabot)
### [`v2.15.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2150)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.14.0...2.15.0)
##### Integrations
- Configure HTTP methods to capture in ASGI/WSGI middleware and frameworks ([#3531](https://redirect.github.com/getsentry/sentry-python/issues/3531)) by [@antonpirker](https://redirect.github.com/antonpirker)
We've added a new option to the Django, Flask, Starlette and FastAPI integrations called `http_methods_to_capture`. This is a configurable tuple of HTTP method verbs that should create a transaction in Sentry. The default is `("CONNECT", "DELETE", "GET", "PATCH", "POST", "PUT", "TRACE",)`. `OPTIONS` and `HEAD` are not included by default.
Here's how to use it (substitute Flask for your framework integration):
```python
sentry_sdk.init(
integrations=[
FlaskIntegration(
http_methods_to_capture=("GET", "POST"),
),
],
)
```
- Django: Allow ASGI to use `drf_request` in `DjangoRequestExtractor` ([#3572](https://redirect.github.com/getsentry/sentry-python/issues/3572)) by [@PakawiNz](https://redirect.github.com/PakawiNz)
- Django: Don't let `RawPostDataException` bubble up ([#3553](https://redirect.github.com/getsentry/sentry-python/issues/3553)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Django: Add `sync_capable` to `SentryWrappingMiddleware` ([#3510](https://redirect.github.com/getsentry/sentry-python/issues/3510)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- AIOHTTP: Add `failed_request_status_codes` ([#3551](https://redirect.github.com/getsentry/sentry-python/issues/3551)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
You can now define a set of integers that will determine which status codes
should be reported to Sentry.
```python
sentry_sdk.init(
integrations=[
AioHttpIntegration(
failed_request_status_codes={403, *range(500, 600)},
)
]
)
```
Examples of valid `failed_request_status_codes`:
- `{500}` will only send events on HTTP 500.
- `{400, *range(500, 600)}` will send events on HTTP 400 as well as the 5xx range.
- `{500, 503}` will send events on HTTP 500 and 503.
- `set()` (the empty set) will not send events for any HTTP status code.
The default is `{*range(500, 600)}`, meaning that all 5xx status codes are reported to Sentry.
- AIOHTTP: Delete test which depends on AIOHTTP behavior ([#3568](https://redirect.github.com/getsentry/sentry-python/issues/3568)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- AIOHTTP: Handle invalid responses ([#3554](https://redirect.github.com/getsentry/sentry-python/issues/3554)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- FastAPI/Starlette: Support new `failed_request_status_codes` ([#3563](https://redirect.github.com/getsentry/sentry-python/issues/3563)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
The format of `failed_request_status_codes` has changed from a list
of integers and containers to a set:
```python
sentry_sdk.init(
integrations=StarletteIntegration(
failed_request_status_codes={403, *range(500, 600)},
),
)
```
The old way of defining `failed_request_status_codes` will continue to work
for the time being. Examples of valid new-style `failed_request_status_codes`:
- `{500}` will only send events on HTTP 500.
- `{400, *range(500, 600)}` will send events on HTTP 400 as well as the 5xx range.
- `{500, 503}` will send events on HTTP 500 and 503.
- `set()` (the empty set) will not send events for any HTTP status code.
The default is `{*range(500, 600)}`, meaning that all 5xx status codes are reported to Sentry.
- FastAPI/Starlette: Fix `failed_request_status_codes=[]` ([#3561](https://redirect.github.com/getsentry/sentry-python/issues/3561)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- FastAPI/Starlette: Remove invalid `failed_request_status_code` tests ([#3560](https://redirect.github.com/getsentry/sentry-python/issues/3560)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- FastAPI/Starlette: Refactor shared test parametrization ([#3562](https://redirect.github.com/getsentry/sentry-python/issues/3562)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
##### Miscellaneous
- Deprecate `sentry_sdk.metrics` ([#3512](https://redirect.github.com/getsentry/sentry-python/issues/3512)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Add `name` parameter to `start_span()` and deprecate `description` parameter ([#3524](https://redirect.github.com/getsentry/sentry-python/issues/3524) & [#3525](https://redirect.github.com/getsentry/sentry-python/issues/3525)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Fix `add_query_source` with modules outside of project root ([#3313](https://redirect.github.com/getsentry/sentry-python/issues/3313)) by [@rominf](https://redirect.github.com/rominf)
- Test more integrations on 3.13 ([#3578](https://redirect.github.com/getsentry/sentry-python/issues/3578)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Fix trailing whitespace ([#3579](https://redirect.github.com/getsentry/sentry-python/issues/3579)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Improve `get_integration` typing ([#3550](https://redirect.github.com/getsentry/sentry-python/issues/3550)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Make import-related tests stable ([#3548](https://redirect.github.com/getsentry/sentry-python/issues/3548)) by [@BYK](https://redirect.github.com/BYK)
- Fix breadcrumb sorting ([#3511](https://redirect.github.com/getsentry/sentry-python/issues/3511)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Fix breadcrumb timestamp casting and its tests ([#3546](https://redirect.github.com/getsentry/sentry-python/issues/3546)) by [@BYK](https://redirect.github.com/BYK)
- Don't use deprecated `logger.warn` ([#3552](https://redirect.github.com/getsentry/sentry-python/issues/3552)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Fix Cohere API change ([#3549](https://redirect.github.com/getsentry/sentry-python/issues/3549)) by [@BYK](https://redirect.github.com/BYK)
- Fix deprecation message ([#3536](https://redirect.github.com/getsentry/sentry-python/issues/3536)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Remove experimental `explain_plan` feature. ([#3534](https://redirect.github.com/getsentry/sentry-python/issues/3534)) by [@antonpirker](https://redirect.github.com/antonpirker)
- X-fail one of the Lambda tests ([#3592](https://redirect.github.com/getsentry/sentry-python/issues/3592)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Update Codecov config ([#3507](https://redirect.github.com/getsentry/sentry-python/issues/3507)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Update `actions/upload-artifact` to `v4` with merge ([#3545](https://redirect.github.com/getsentry/sentry-python/issues/3545)) by [@joshuarli](https://redirect.github.com/joshuarli)
- Bump `actions/checkout` from `4.1.7` to `4.2.0` ([#3585](https://redirect.github.com/getsentry/sentry-python/issues/3585)) by [@dependabot](https://redirect.github.com/dependabot)
### [`v2.14.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2140)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.13.0...2.14.0)
##### Various fixes & improvements
- New `SysExitIntegration` ([#3401](https://redirect.github.com/getsentry/sentry-python/issues/3401)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
For more information, see the documentation for the [SysExitIntegration](https://docs.sentry.io/platforms/python/integrations/sys_exit).
- Add `SENTRY_SPOTLIGHT` env variable support ([#3443](https://redirect.github.com/getsentry/sentry-python/issues/3443)) by [@BYK](https://redirect.github.com/BYK)
- Support Strawberry `0.239.2` ([#3491](https://redirect.github.com/getsentry/sentry-python/issues/3491)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Add separate `pii_denylist` to `EventScrubber` and run it always ([#3463](https://redirect.github.com/getsentry/sentry-python/issues/3463)) by [@sl0thentr0py](https://redirect.github.com/sl0thentr0py)
- Celery: Add wrapper for `Celery().send_task` to support behavior as `Task.apply_async` ([#2377](https://redirect.github.com/getsentry/sentry-python/issues/2377)) by [@divaltor](https://redirect.github.com/divaltor)
- Django: SentryWrappingMiddleware.**init** fails if super() is object ([#2466](https://redirect.github.com/getsentry/sentry-python/issues/2466)) by [@cameron-simpson](https://redirect.github.com/cameron-simpson)
- Fix data_category for sessions envelope items ([#3473](https://redirect.github.com/getsentry/sentry-python/issues/3473)) by [@sl0thentr0py](https://redirect.github.com/sl0thentr0py)
- Fix non-UTC timestamps ([#3461](https://redirect.github.com/getsentry/sentry-python/issues/3461)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Remove obsolete object as superclass ([#3480](https://redirect.github.com/getsentry/sentry-python/issues/3480)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Replace custom `TYPE_CHECKING` with stdlib `typing.TYPE_CHECKING` ([#3447](https://redirect.github.com/getsentry/sentry-python/issues/3447)) by [@dev-satoshi](https://redirect.github.com/dev-satoshi)
- Refactor `tracing_utils.py` ([#3452](https://redirect.github.com/getsentry/sentry-python/issues/3452)) by [@rominf](https://redirect.github.com/rominf)
- Explicitly export symbol in subpackages instead of ignoring ([#3400](https://redirect.github.com/getsentry/sentry-python/issues/3400)) by [@hartungstenio](https://redirect.github.com/hartungstenio)
- Better test coverage reports ([#3498](https://redirect.github.com/getsentry/sentry-python/issues/3498)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Fixed config for old coverage versions ([#3504](https://redirect.github.com/getsentry/sentry-python/issues/3504)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Fix AWS Lambda tests ([#3495](https://redirect.github.com/getsentry/sentry-python/issues/3495)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Remove broken Bottle tests ([#3505](https://redirect.github.com/getsentry/sentry-python/issues/3505)) by [@sentrivana](https://redirect.github.com/sentrivana)
### [`v2.13.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2130)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.12.0...2.13.0)
##### Various fixes & improvements
- **New integration:** [Ray](https://docs.sentry.io/platforms/python/integrations/ray/) ([#2400](https://redirect.github.com/getsentry/sentry-python/issues/2400)) ([#2444](https://redirect.github.com/getsentry/sentry-python/issues/2444)) by [@glowskir](https://redirect.github.com/glowskir)
Usage: (add the RayIntegration to your `sentry_sdk.init()` call and make sure it is called in the worker processes)
```python
import ray
import sentry_sdk
from sentry_sdk.integrations.ray import RayIntegration
def init_sentry():
sentry_sdk.init(
dsn="...",
traces_sample_rate=1.0,
integrations=[RayIntegration()],
)
init_sentry()
ray.init(
runtime_env=dict(worker_process_setup_hook=init_sentry),
)
```
For more information, see the documentation for the [Ray integration](https://docs.sentry.io/platforms/python/integrations/ray/).
- **New integration:** [Litestar](https://docs.sentry.io/platforms/python/integrations/litestar/) ([#2413](https://redirect.github.com/getsentry/sentry-python/issues/2413)) ([#3358](https://redirect.github.com/getsentry/sentry-python/issues/3358)) by [@KellyWalker](https://redirect.github.com/KellyWalker)
Usage: (add the LitestarIntegration to your `sentry_sdk.init()`)
```python
from litestar import Litestar, get
import sentry_sdk
from sentry_sdk.integrations.litestar import LitestarIntegration
sentry_sdk.init(
dsn="...",
traces_sample_rate=1.0,
integrations=[LitestarIntegration()],
)
@get("/")
async def index() -> str:
return "Hello, world!"
app = Litestar(...)
```
For more information, see the documentation for the [Litestar integration](https://docs.sentry.io/platforms/python/integrations/litestar/).
- **New integration:** [Dramatiq](https://docs.sentry.io/platforms/python/integrations/dramatiq/) from [@jacobsvante](https://redirect.github.com/jacobsvante) ([#3397](https://redirect.github.com/getsentry/sentry-python/issues/3397)) by [@antonpirker](https://redirect.github.com/antonpirker)
Usage: (add the DramatiqIntegration to your `sentry_sdk.init()`)
```python
import dramatiq
import sentry_sdk
from sentry_sdk.integrations.dramatiq import DramatiqIntegration
sentry_sdk.init(
dsn="...",
traces_sample_rate=1.0,
integrations=[DramatiqIntegration()],
)
@dramatiq.actor(max_retries=0)
def dummy_actor(x, y):
return x / y
dummy_actor.send(12, 0)
```
For more information, see the documentation for the [Dramatiq integration](https://docs.sentry.io/platforms/python/integrations/dramatiq/).
- **New config option:** Expose `custom_repr` function that precedes `safe_repr` invocation in serializer ([#3438](https://redirect.github.com/getsentry/sentry-python/issues/3438)) by [@sl0thentr0py](https://redirect.github.com/sl0thentr0py)
See: https://docs.sentry.io/platforms/python/configuration/options/#custom-repr
- Profiling: Add client SDK info to profile chunk ([#3386](https://redirect.github.com/getsentry/sentry-python/issues/3386)) by [@Zylphrex](https://redirect.github.com/Zylphrex)
- Serialize vars early to avoid living references ([#3409](https://redirect.github.com/getsentry/sentry-python/issues/3409)) by [@sl0thentr0py](https://redirect.github.com/sl0thentr0py)
- Deprecate hub-based `sessions.py` logic ([#3419](https://redirect.github.com/getsentry/sentry-python/issues/3419)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Deprecate `is_auto_session_tracking_enabled` ([#3428](https://redirect.github.com/getsentry/sentry-python/issues/3428)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Add note to generated yaml files ([#3423](https://redirect.github.com/getsentry/sentry-python/issues/3423)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Slim down PR template ([#3382](https://redirect.github.com/getsentry/sentry-python/issues/3382)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Use new banner in readme ([#3390](https://redirect.github.com/getsentry/sentry-python/issues/3390)) by [@sentrivana](https://redirect.github.com/sentrivana)
### [`v2.12.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2120)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.11.0...2.12.0)
##### Various fixes & improvements
- API: Expose the scope getters to top level API and use them everywhere ([#3357](https://redirect.github.com/getsentry/sentry-python/issues/3357)) by [@sl0thentr0py](https://redirect.github.com/sl0thentr0py)
- API: `push_scope` deprecation warning ([#3355](https://redirect.github.com/getsentry/sentry-python/issues/3355)) ([#3355](https://redirect.github.com/getsentry/sentry-python/issues/3355)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- API: Replace `push_scope` ([#3353](https://redirect.github.com/getsentry/sentry-python/issues/3353), [#3354](https://redirect.github.com/getsentry/sentry-python/issues/3354)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- API: Deprecate, avoid, or stop using `configure_scope` ([#3348](https://redirect.github.com/getsentry/sentry-python/issues/3348), [#3349](https://redirect.github.com/getsentry/sentry-python/issues/3349), [#3350](https://redirect.github.com/getsentry/sentry-python/issues/3350), [#3351](https://redirect.github.com/getsentry/sentry-python/issues/3351)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- OTel: Remove experimental autoinstrumentation ([#3239](https://redirect.github.com/getsentry/sentry-python/issues/3239)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Graphene: Add span for grapqhl operation ([#2788](https://redirect.github.com/getsentry/sentry-python/issues/2788)) by [@czyber](https://redirect.github.com/czyber)
- AI: Add async support for `ai_track` decorator ([#3376](https://redirect.github.com/getsentry/sentry-python/issues/3376)) by [@czyber](https://redirect.github.com/czyber)
- CI: Workaround bug preventing Django test runs ([#3371](https://redirect.github.com/getsentry/sentry-python/issues/3371)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- CI: Remove Django setuptools pin ([#3378](https://redirect.github.com/getsentry/sentry-python/issues/3378)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Tests: Test with Django 5.1 RC ([#3370](https://redirect.github.com/getsentry/sentry-python/issues/3370)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Broaden `add_attachment` type ([#3342](https://redirect.github.com/getsentry/sentry-python/issues/3342)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Add span data to the transactions trace context ([#3374](https://redirect.github.com/getsentry/sentry-python/issues/3374)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Gracefully fail attachment path not found case ([#3337](https://redirect.github.com/getsentry/sentry-python/issues/3337)) by [@sl0thentr0py](https://redirect.github.com/sl0thentr0py)
- Document attachment parameters ([#3342](https://redirect.github.com/getsentry/sentry-python/issues/3342)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Bump checkouts/data-schemas from `0feb234` to `6d2c435` ([#3369](https://redirect.github.com/getsentry/sentry-python/issues/3369)) by [@dependabot](https://redirect.github.com/dependabot)
- Bump checkouts/data-schemas from `88273a9` to `0feb234` ([#3252](https://redirect.github.com/getsentry/sentry-python/issues/3252)) by [@dependabot](https://redirect.github.com/dependabot)
### [`v2.11.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2110)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.10.0...2.11.0)
##### Various fixes & improvements
- Add `disabled_integrations` ([#3328](https://redirect.github.com/getsentry/sentry-python/issues/3328)) by [@sentrivana](https://redirect.github.com/sentrivana)
Disabling individual integrations is now much easier.
Instead of disabling all automatically enabled integrations and specifying the ones
you want to keep, you can now use the new
[`disabled_integrations`](https://docs.sentry.io/platforms/python/configuration/options/#auto-enabling-integrations)
config option to provide a list of integrations to disable:
```python
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
sentry_sdk.init(
```
### Do not use the Flask integration even if Flask is installed.
disabled_integrations=[
FlaskIntegration(),
],
)
```
- Use operation name as transaction name in Strawberry (#3294) by @sentrivana
- WSGI integrations respect `SCRIPT_NAME` env variable (#2622) by @sarvaSanjay
- Make Django DB spans have origin `auto.db.django` (#3319) by @antonpirker
- Sort breadcrumbs by time before sending (#3307) by @antonpirker
- Fix `KeyError('sentry-monitor-start-timestamp-s')` (#3278) by @Mohsen-Khodabakhshi
- Set MongoDB tags directly on span data (#3290) by @0Calories
- Lower logger level for some messages (#3305) by @sentrivana and @antonpirker
- Emit deprecation warnings from `Hub` API (#3280) by @szokeasaurusrex
- Clarify that `instrumenter` is internal-only (#3299) by @szokeasaurusrex
- Support Django 5.1 (#3207) by @sentrivana
- Remove apparently unnecessary `if` (#3298) by @szokeasaurusrex
- Preliminary support for Python 3.13 (#3200) by @sentrivana
- Move `sentry_sdk.init` out of `hub.py` (#3276) by @szokeasaurusrex
- Unhardcode integration list (#3240) by @rominf
- Allow passing of PostgreSQL port in tests (#3281) by @rominf
- Add tests for `@ai_track` decorator (#3325) by @colin-sentry
- Do not include type checking code in coverage report (#3327) by @antonpirker
- Fix test_installed_modules (#3309) by @szokeasaurusrex
- Fix typos and grammar in a comment (#3293) by @szokeasaurusrex
- Fixed failed tests setup (#3303) by @antonpirker
- Only assert warnings we are interested in (#3314) by @szokeasaurusrex
```
### [`v2.10.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2100)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.9.0...2.10.0)
##### Various fixes & improvements
- Add client cert and key support to `HttpTransport` ([#3258](https://redirect.github.com/getsentry/sentry-python/issues/3258)) by [@grammy-jiang](https://redirect.github.com/grammy-jiang)
Add `cert_file` and `key_file` to your `sentry_sdk.init` to use a custom client cert and key. Alternatively, the environment variables `CLIENT_CERT_FILE` and `CLIENT_KEY_FILE` can be used as well.
- OpenAI: Lazy initialize tiktoken to avoid http at import time ([#3287](https://redirect.github.com/getsentry/sentry-python/issues/3287)) by [@colin-sentry](https://redirect.github.com/colin-sentry)
- OpenAI, Langchain: Make tiktoken encoding name configurable + tiktoken usage opt-in ([#3289](https://redirect.github.com/getsentry/sentry-python/issues/3289)) by [@colin-sentry](https://redirect.github.com/colin-sentry)
Fixed a bug where having certain packages installed along the Sentry SDK caused an HTTP request to be made to OpenAI infrastructure when the Sentry SDK was initialized. The request was made when the `tiktoken` package and at least one of the `openai` or `langchain` packages were installed.
The request was fetching a `tiktoken` encoding in order to correctly measure token usage in some OpenAI and Langchain calls. This behavior is now opt-in. The choice of encoding to use was made configurable as well. To opt in, set the `tiktoken_encoding_name` parameter in the OpenAPI or Langchain integration.
```python
sentry_sdk.init(
integrations=[
OpenAIIntegration(tiktoken_encoding_name="cl100k_base"),
LangchainIntegration(tiktoken_encoding_name="cl100k_base"),
],
)
```
- PyMongo: Send query description as valid JSON ([#3291](https://redirect.github.com/getsentry/sentry-python/issues/3291)) by [@0Calories](https://redirect.github.com/0Calories)
- Remove Python 2 compatibility code ([#3284](https://redirect.github.com/getsentry/sentry-python/issues/3284)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Fix `sentry_sdk.init` type hint ([#3283](https://redirect.github.com/getsentry/sentry-python/issues/3283)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Deprecate `hub` in `Profile` ([#3270](https://redirect.github.com/getsentry/sentry-python/issues/3270)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Stop using `Hub` in `init` ([#3275](https://redirect.github.com/getsentry/sentry-python/issues/3275)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Delete `_should_send_default_pii` ([#3274](https://redirect.github.com/getsentry/sentry-python/issues/3274)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Remove `Hub` usage in `conftest` ([#3273](https://redirect.github.com/getsentry/sentry-python/issues/3273)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Rename debug logging filter ([#3260](https://redirect.github.com/getsentry/sentry-python/issues/3260)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Update `NoOpSpan.finish` signature ([#3267](https://redirect.github.com/getsentry/sentry-python/issues/3267)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Remove `Hub` in `Transaction.finish` ([#3267](https://redirect.github.com/getsentry/sentry-python/issues/3267)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Remove Hub from `capture_internal_exception` logic ([#3264](https://redirect.github.com/getsentry/sentry-python/issues/3264)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Improve `Scope._capture_internal_exception` type hint ([#3264](https://redirect.github.com/getsentry/sentry-python/issues/3264)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Correct `ExcInfo` type ([#3266](https://redirect.github.com/getsentry/sentry-python/issues/3266)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Stop using `Hub` in `tracing_utils` ([#3269](https://redirect.github.com/getsentry/sentry-python/issues/3269)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
### [`v2.9.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#290)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.8.0...2.9.0)
##### Various fixes & improvements
- ref(transport): Improve event data category typing ([#3243](https://redirect.github.com/getsentry/sentry-python/issues/3243)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- ref(tracing): Improved handling of span status ([#3261](https://redirect.github.com/getsentry/sentry-python/issues/3261)) by [@antonpirker](https://redirect.github.com/antonpirker)
- test(client): Add tests for dropped span client reports ([#3244](https://redirect.github.com/getsentry/sentry-python/issues/3244)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- test(transport): Test new client report features ([#3244](https://redirect.github.com/getsentry/sentry-python/issues/3244)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- feat(tracing): Record lost spans in client reports ([#3244](https://redirect.github.com/getsentry/sentry-python/issues/3244)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- test(sampling): Replace custom logic with `capture_record_lost_event_calls` ([#3257](https://redirect.github.com/getsentry/sentry-python/issues/3257)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- test(transport): Non-order-dependent discarded events assertion ([#3255](https://redirect.github.com/getsentry/sentry-python/issues/3255)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- test(core): Introduce `capture_record_lost_event_calls` fixture ([#3254](https://redirect.github.com/getsentry/sentry-python/issues/3254)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- test(core): Fix non-idempotent test ([#3253](https://redirect.github.com/getsentry/sentry-python/issues/3253)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
### [`v2.8.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#280)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.7.1...2.8.0)
##### Various fixes & improvements
- `profiler_id` uses underscore ([#3249](https://redirect.github.com/getsentry/sentry-python/issues/3249)) by [@Zylphrex](https://redirect.github.com/Zylphrex)
- Don't send full env to subprocess ([#3251](https://redirect.github.com/getsentry/sentry-python/issues/3251)) by [@kmichel-aiven](https://redirect.github.com/kmichel-aiven)
- Stop using `Hub` in `HttpTransport` ([#3247](https://redirect.github.com/getsentry/sentry-python/issues/3247)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Remove `ipdb` from test requirements ([#3237](https://redirect.github.com/getsentry/sentry-python/issues/3237)) by [@rominf](https://redirect.github.com/rominf)
- Avoid propagation of empty baggage ([#2968](https://redirect.github.com/getsentry/sentry-python/issues/2968)) by [@hartungstenio](https://redirect.github.com/hartungstenio)
- Add entry point for `SentryPropagator` ([#3086](https://redirect.github.com/getsentry/sentry-python/issues/3086)) by [@mender](https://redirect.github.com/mender)
- Bump checkouts/data-schemas from `8c13457` to `88273a9` ([#3225](https://redirect.github.com/getsentry/sentry-python/issues/3225)) by [@dependabot](https://redirect.github.com/dependabot)
### [`v2.7.1`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#271)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.7.0...2.7.1)
##### Various fixes & improvements
- fix(otel): Fix missing baggage ([#3218](https://redirect.github.com/getsentry/sentry-python/issues/3218)) by [@sentrivana](https://redirect.github.com/sentrivana)
- This is the config file of asdf-vm which we do not use. ([#3215](https://redirect.github.com/getsentry/sentry-python/issues/3215)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Added option to disable middleware spans in Starlette ([#3052](https://redirect.github.com/getsentry/sentry-python/issues/3052)) by [@antonpirker](https://redirect.github.com/antonpirker)
- build: Update tornado version in setup.py to match code check. ([#3206](https://redirect.github.com/getsentry/sentry-python/issues/3206)) by [@aclemons](https://redirect.github.com/aclemons)
### [`v2.7.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#270)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.6.0...2.7.0)
- Add `origin` to spans and transactions ([#3133](https://redirect.github.com/getsentry/sentry-python/issues/3133)) by [@antonpirker](https://redirect.github.com/antonpirker)
- OTel: Set up typing for OTel ([#3168](https://redirect.github.com/getsentry/sentry-python/issues/3168)) by [@sentrivana](https://redirect.github.com/sentrivana)
- OTel: Auto instrumentation skeleton ([#3143](https://redirect.github.com/getsentry/sentry-python/issues/3143)) by [@sentrivana](https://redirect.github.com/sentrivana)
- OpenAI: If there is an internal error, still return a value ([#3192](https://redirect.github.com/getsentry/sentry-python/issues/3192)) by [@colin-sentry](https://redirect.github.com/colin-sentry)
- MongoDB: Add MongoDB collection span tag ([#3182](https://redirect.github.com/getsentry/sentry-python/issues/3182)) by [@0Calories](https://redirect.github.com/0Calories)
- MongoDB: Change span operation from `db.query` to `db` ([#3186](https://redirect.github.com/getsentry/sentry-python/issues/3186)) by [@0Calories](https://redirect.github.com/0Calories)
- MongoDB: Remove redundant command name in query description ([#3189](https://redirect.github.com/getsentry/sentry-python/issues/3189)) by [@0Calories](https://redirect.github.com/0Calories)
- Apache Spark: Fix spark driver integration ([#3162](https://redirect.github.com/getsentry/sentry-python/issues/3162)) by [@seyoon-lim](https://redirect.github.com/seyoon-lim)
- Apache Spark: Add Spark test suite to tox.ini and to CI ([#3199](https://redirect.github.com/getsentry/sentry-python/issues/3199)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Codecov: Add failed test commits in PRs ([#3190](https://redirect.github.com/getsentry/sentry-python/issues/3190)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Update library, Python versions in tests ([#3202](https://redirect.github.com/getsentry/sentry-python/issues/3202)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Remove Hub from our test suite ([#3197](https://redirect.github.com/getsentry/sentry-python/issues/3197)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Use env vars for default CA cert bundle location ([#3160](https://redirect.github.com/getsentry/sentry-python/issues/3160)) by [@DragoonAethis](https://redirect.github.com/DragoonAethis)
- Create a separate test group for AI ([#3198](https://redirect.github.com/getsentry/sentry-python/issues/3198)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Add additional stub packages for type checking ([#3122](https://redirect.github.com/getsentry/sentry-python/issues/3122)) by [@Daverball](https://redirect.github.com/Daverball)
- Proper naming of requirements files ([#3191](https://redirect.github.com/getsentry/sentry-python/issues/3191)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Pinning pip because new version does not work with some versions of Celery and Httpx ([#3195](https://redirect.github.com/getsentry/sentry-python/issues/3195)) by [@antonpirker](https://redirect.github.com/antonpirker)
- build(deps): bump supercharge/redis-github-action from 1.7.0 to 1.8.0 ([#3193](https://redirect.github.com/getsentry/sentry-python/issues/3193)) by [@dependabot](https://redirect.github.com/dependabot)
- build(deps): bump actions/checkout from 4.1.6 to 4.1.7 ([#3171](https://redirect.github.com/getsentry/sentry-python/issues/3171)) by [@dependabot](https://redirect.github.com/dependabot)
- build(deps): update pytest-asyncio requirement ([#3087](https://redirect.github.com/getsentry/sentry-python/issues/3087)) by [@dependabot](https://redirect.github.com/dependabot)
### [`v2.6.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#260)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.5.1...2.6.0)
- Introduce continuous profiling mode ([#2830](https://redirect.github.com/getsentry/sentry-python/issues/2830)) by [@Zylphrex](https://redirect.github.com/Zylphrex)
- Profiling: Add deprecation comment for profiler internals ([#3167](https://redirect.github.com/getsentry/sentry-python/issues/3167)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Profiling: Move thread data to trace context ([#3157](https://redirect.github.com/getsentry/sentry-python/issues/3157)) by [@Zylphrex](https://redirect.github.com/Zylphrex)
- Explicitly export cron symbols for typecheckers ([#3072](https://redirect.github.com/getsentry/sentry-python/issues/3072)) by [@spladug](https://redirect.github.com/spladug)
- Cleaning up ASGI tests for Django ([#3180](https://redirect.github.com/getsentry/sentry-python/issues/3180)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Celery: Add Celery receive latency ([#3174](https://redirect.github.com/getsentry/sentry-python/issues/3174)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Metrics: Update type hints for tag values ([#3156](https://redirect.github.com/getsentry/sentry-python/issues/3156)) by [@elramen](https://redirect.github.com/elramen)
- Django: Fix psycopg3 reconnect error ([#3111](https://redirect.github.com/getsentry/sentry-python/issues/3111)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- Tracing: Keep original function signature when decorated ([#3178](https://redirect.github.com/getsentry/sentry-python/issues/3178)) by [@sentrivana](https://redirect.github.com/sentrivana)
- Reapply "Refactor the Celery Beat integration ([#3105](https://redirect.github.com/getsentry/sentry-python/issues/3105))" ([#3144](https://redirect.github.com/getsentry/sentry-python/issues/3144)) ([#3175](https://redirect.github.com/getsentry/sentry-python/issues/3175)) by [@antonpirker](https://redirect.github.com/antonpirker)
- Added contributor image to readme ([#3183](https://redirect.github.com/getsentry/sentry-python/issues/3183)) by [@antonpirker](https://redirect.github.com/antonpirker)
- bump actions/checkout from 4.1.4 to 4.1.6 ([#3147](https://redirect.github.com/getsentry/sentry-python/issues/3147)) by [@dependabot](https://redirect.github.com/dependabot)
- bump checkouts/data-schemas from `59f9683` to `8c13457` ([#3146](https://redirect.github.com/getsentry/sentry-python/issues/3146)) by [@dependabot](https://redirect.github.com/dependabot)
### [`v2.5.1`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#251)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.5.0...2.5.1)
This change fixes a regression in our cron monitoring feature, which caused cron checkins not to be sent. The regression appears to have been introduced in version 2.4.0.
**We recommend that all users, who use Cron monitoring and are currently running sentry-python ≥2.4.0, upgrade to this release as soon as possible!**
##### Other fixes & improvements
- feat(tracing): Warn if not-started transaction entered ([#3003](https://redirect.github.com/getsentry/sentry-python/issues/3003)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- test(scope): Ensure `last_event_id` cleared ([#3124](https://redirect.github.com/getsentry/sentry-python/issues/3124)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
- fix(scope): Clear last_event_id on scope clear ([#3124](https://redirect.github.com/getsentry/sentry-python/issues/3124)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex)
### [`v2.5.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#250)
[Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.4.0...2.5.0)
##### Various fixes & improvements
- Allow to configure status codes to report to Sentry in Starlette and FastAPI ([#3008](https://redirect.github.com/getsentry/sentry-python/issues/3008)) by [@sentrivana](https://redirect.github.com/sentrivana)
By passing a new option to the FastAPI and Starlette integrations, you're now able to configure what
status codes should be sent as events to Sentry. Here's how it works:
```python
from sentry_sdk.integrations.starlette import StarletteIntegration
from sentry_sdk.integrations.fastapi import FastApiIntegration
sentry_sdk.init(
```
### ...
integrations=[
StarletteIntegration(
failed_request_status_codes=[403, range(500, 599)],
),
FastApiIntegration(
failed_request_status_codes=[403, range(500, 599)],
),
]
)
Configuration
📅 Schedule: Branch creation - "before 4am on the first day of the month" in timezone Asia/Singapore, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
==1.45.1
->==2.19.0
Release Notes
getsentry/sentry-python (sentry-sdk)
### [`v2.19.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2190) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.18.0...2.19.0) ##### Various fixes & improvements - New: introduce `rust_tracing` integration. See https://docs.sentry.io/platforms/python/integrations/rust_tracing/ ([#3717](https://redirect.github.com/getsentry/sentry-python/issues/3717)) by [@matt-codecov](https://redirect.github.com/matt-codecov) - Auto enable Litestar integration ([#3540](https://redirect.github.com/getsentry/sentry-python/issues/3540)) by [@provinzkraut](https://redirect.github.com/provinzkraut) - Deprecate `sentry_sdk.init` context manager ([#3729](https://redirect.github.com/getsentry/sentry-python/issues/3729)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - feat(spotlight): Send PII to Spotlight when no DSN is set ([#3804](https://redirect.github.com/getsentry/sentry-python/issues/3804)) by [@BYK](https://redirect.github.com/BYK) - feat(spotlight): Add info logs when Sentry is enabled ([#3735](https://redirect.github.com/getsentry/sentry-python/issues/3735)) by [@BYK](https://redirect.github.com/BYK) - feat(spotlight): Inject Spotlight button on Django ([#3751](https://redirect.github.com/getsentry/sentry-python/issues/3751)) by [@BYK](https://redirect.github.com/BYK) - feat(spotlight): Auto enable cache_spans for Spotlight on DEBUG ([#3791](https://redirect.github.com/getsentry/sentry-python/issues/3791)) by [@BYK](https://redirect.github.com/BYK) - fix(logging): Handle parameter `stack_info` for the `LoggingIntegration` ([#3745](https://redirect.github.com/getsentry/sentry-python/issues/3745)) by [@gmcrocetti](https://redirect.github.com/gmcrocetti) - fix(pure-eval): Make sentry-sdk\[pure-eval] installable with pip==24.0 ([#3757](https://redirect.github.com/getsentry/sentry-python/issues/3757)) by [@sentrivana](https://redirect.github.com/sentrivana) - fix(rust_tracing): include_tracing_fields arg to control unvetted data in rust_tracing integration ([#3780](https://redirect.github.com/getsentry/sentry-python/issues/3780)) by [@matt-codecov](https://redirect.github.com/matt-codecov) - fix(aws) Fix aws lambda tests (by reducing event size) ([#3770](https://redirect.github.com/getsentry/sentry-python/issues/3770)) by [@antonpirker](https://redirect.github.com/antonpirker) - fix(arq): fix integration with Worker settings as a dict ([#3742](https://redirect.github.com/getsentry/sentry-python/issues/3742)) by [@saber-solooki](https://redirect.github.com/saber-solooki) - fix(httpx): Prevent Sentry baggage duplication ([#3728](https://redirect.github.com/getsentry/sentry-python/issues/3728)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - fix(falcon): Don't exhaust request body stream ([#3768](https://redirect.github.com/getsentry/sentry-python/issues/3768)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - fix(integrations): Check `retries_left` before capturing exception ([#3803](https://redirect.github.com/getsentry/sentry-python/issues/3803)) by [@malkovro](https://redirect.github.com/malkovro) - fix(openai): Use name instead of description ([#3807](https://redirect.github.com/getsentry/sentry-python/issues/3807)) by [@sourceful-rob](https://redirect.github.com/sourceful-rob) - test(gcp): Only run GCP tests when they should ([#3721](https://redirect.github.com/getsentry/sentry-python/issues/3721)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - chore: Shorten CI workflow names ([#3805](https://redirect.github.com/getsentry/sentry-python/issues/3805)) by [@sentrivana](https://redirect.github.com/sentrivana) - chore: Test with pyspark prerelease ([#3760](https://redirect.github.com/getsentry/sentry-python/issues/3760)) by [@sentrivana](https://redirect.github.com/sentrivana) - build(deps): bump codecov/codecov-action from 4.6.0 to 5.0.2 ([#3792](https://redirect.github.com/getsentry/sentry-python/issues/3792)) by [@dependabot](https://redirect.github.com/dependabot) - build(deps): bump actions/checkout from 4.2.1 to 4.2.2 ([#3691](https://redirect.github.com/getsentry/sentry-python/issues/3691)) by [@dependabot](https://redirect.github.com/dependabot) ### [`v2.18.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2180) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.17.0...2.18.0) ##### Various fixes & improvements - Add LaunchDarkly and OpenFeature integration ([#3648](https://redirect.github.com/getsentry/sentry-python/issues/3648)) by [@cmanallen](https://redirect.github.com/cmanallen) - Correct typo in a comment ([#3726](https://redirect.github.com/getsentry/sentry-python/issues/3726)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - End `http.client` span on timeout ([#3723](https://redirect.github.com/getsentry/sentry-python/issues/3723)) by [@Zylphrex](https://redirect.github.com/Zylphrex) - Check for `h2` existence in HTTP/2 transport ([#3690](https://redirect.github.com/getsentry/sentry-python/issues/3690)) by [@BYK](https://redirect.github.com/BYK) - Use `type()` instead when extracting frames ([#3716](https://redirect.github.com/getsentry/sentry-python/issues/3716)) by [@Zylphrex](https://redirect.github.com/Zylphrex) - Prefer `python_multipart` import over `multipart` ([#3710](https://redirect.github.com/getsentry/sentry-python/issues/3710)) by [@musicinmybrain](https://redirect.github.com/musicinmybrain) - Update active thread for asgi ([#3669](https://redirect.github.com/getsentry/sentry-python/issues/3669)) by [@Zylphrex](https://redirect.github.com/Zylphrex) - Only enable HTTP2 when DSN is HTTPS ([#3678](https://redirect.github.com/getsentry/sentry-python/issues/3678)) by [@BYK](https://redirect.github.com/BYK) - Prepare for upstream Strawberry extension removal ([#3649](https://redirect.github.com/getsentry/sentry-python/issues/3649)) by [@DoctorJohn](https://redirect.github.com/DoctorJohn) - Enhance README with improved clarity and developer-friendly examples ([#3667](https://redirect.github.com/getsentry/sentry-python/issues/3667)) by [@UTSAVS26](https://redirect.github.com/UTSAVS26) - Run license compliance action on all PRs ([#3699](https://redirect.github.com/getsentry/sentry-python/issues/3699)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Run CodeQL action on all PRs ([#3698](https://redirect.github.com/getsentry/sentry-python/issues/3698)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Fix UTC assuming test ([#3722](https://redirect.github.com/getsentry/sentry-python/issues/3722)) by [@BYK](https://redirect.github.com/BYK) - Exclude fakeredis 2.26.0 on py3.6 and 3.7 ([#3695](https://redirect.github.com/getsentry/sentry-python/issues/3695)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Unpin `pytest` for `tornado-latest` tests ([#3714](https://redirect.github.com/getsentry/sentry-python/issues/3714)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Install `pytest-asyncio` for `redis` tests (Python 3.12-13) ([#3706](https://redirect.github.com/getsentry/sentry-python/issues/3706)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Clarify that only pinned tests are required ([#3713](https://redirect.github.com/getsentry/sentry-python/issues/3713)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Remove accidentally-committed print ([#3712](https://redirect.github.com/getsentry/sentry-python/issues/3712)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Disable broken RQ test in newly-released RQ 2.0 ([#3708](https://redirect.github.com/getsentry/sentry-python/issues/3708)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Unpin `pytest` for `celery` tests ([#3701](https://redirect.github.com/getsentry/sentry-python/issues/3701)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Unpin `pytest` on Python 3.8+ `gevent` tests ([#3700](https://redirect.github.com/getsentry/sentry-python/issues/3700)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Unpin `pytest` for Python 3.8+ `common` tests ([#3697](https://redirect.github.com/getsentry/sentry-python/issues/3697)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Remove `pytest` pin in `requirements-devenv.txt` ([#3696](https://redirect.github.com/getsentry/sentry-python/issues/3696)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Test with Falcon 4.0 ([#3684](https://redirect.github.com/getsentry/sentry-python/issues/3684)) by [@sentrivana](https://redirect.github.com/sentrivana) ### [`v2.17.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2170) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.16.0...2.17.0) ##### Various fixes & improvements - Add support for async calls in Anthropic and OpenAI integration ([#3497](https://redirect.github.com/getsentry/sentry-python/issues/3497)) by [@vetyy](https://redirect.github.com/vetyy) - Allow custom transaction names in ASGI ([#3664](https://redirect.github.com/getsentry/sentry-python/issues/3664)) by [@sl0thentr0py](https://redirect.github.com/sl0thentr0py) - Langchain: Handle case when parent span wasn't traced ([#3656](https://redirect.github.com/getsentry/sentry-python/issues/3656)) by [@rbasoalto](https://redirect.github.com/rbasoalto) - Fix Anthropic integration when using tool calls ([#3615](https://redirect.github.com/getsentry/sentry-python/issues/3615)) by [@kwnath](https://redirect.github.com/kwnath) - More defensive Django Spotlight middleware injection ([#3665](https://redirect.github.com/getsentry/sentry-python/issues/3665)) by [@BYK](https://redirect.github.com/BYK) - Remove `ensure_integration_enabled_async` ([#3632](https://redirect.github.com/getsentry/sentry-python/issues/3632)) by [@sentrivana](https://redirect.github.com/sentrivana) - Test with newer Falcon version ([#3644](https://redirect.github.com/getsentry/sentry-python/issues/3644), [#3653](https://redirect.github.com/getsentry/sentry-python/issues/3653), [#3662](https://redirect.github.com/getsentry/sentry-python/issues/3662)) by [@sentrivana](https://redirect.github.com/sentrivana) - Fix mypy ([#3657](https://redirect.github.com/getsentry/sentry-python/issues/3657)) by [@sentrivana](https://redirect.github.com/sentrivana) - Fix flaky transport test ([#3666](https://redirect.github.com/getsentry/sentry-python/issues/3666)) by [@sentrivana](https://redirect.github.com/sentrivana) - Remove pin on `sphinx` ([#3650](https://redirect.github.com/getsentry/sentry-python/issues/3650)) by [@sentrivana](https://redirect.github.com/sentrivana) - Bump `actions/checkout` from `4.2.0` to `4.2.1` ([#3651](https://redirect.github.com/getsentry/sentry-python/issues/3651)) by [@dependabot](https://redirect.github.com/dependabot) ### [`v2.16.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2160) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.15.0...2.16.0) ##### Integrations - Bottle: Add `failed_request_status_codes` ([#3618](https://redirect.github.com/getsentry/sentry-python/issues/3618)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) You can now define a set of integers that will determine which status codes should be reported to Sentry. ```python sentry_sdk.init( integrations=[ BottleIntegration( failed_request_status_codes={403, *range(500, 600)}, ) ] ) ``` Examples of valid `failed_request_status_codes`: - `{500}` will only send events on HTTP 500. - `{400, *range(500, 600)}` will send events on HTTP 400 as well as the 5xx range. - `{500, 503}` will send events on HTTP 500 and 503. - `set()` (the empty set) will not send events for any HTTP status code. The default is `{*range(500, 600)}`, meaning that all 5xx status codes are reported to Sentry. - Bottle: Delete never-reached code ([#3605](https://redirect.github.com/getsentry/sentry-python/issues/3605)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Redis: Remove flaky test ([#3626](https://redirect.github.com/getsentry/sentry-python/issues/3626)) by [@sentrivana](https://redirect.github.com/sentrivana) - Django: Improve getting `psycopg3` connection info ([#3580](https://redirect.github.com/getsentry/sentry-python/issues/3580)) by [@nijel](https://redirect.github.com/nijel) - Django: Add `SpotlightMiddleware` when Spotlight is enabled ([#3600](https://redirect.github.com/getsentry/sentry-python/issues/3600)) by [@BYK](https://redirect.github.com/BYK) - Django: Open relevant error when `SpotlightMiddleware` is on ([#3614](https://redirect.github.com/getsentry/sentry-python/issues/3614)) by [@BYK](https://redirect.github.com/BYK) - Django: Support `http_methods_to_capture` in ASGI Django ([#3607](https://redirect.github.com/getsentry/sentry-python/issues/3607)) by [@sentrivana](https://redirect.github.com/sentrivana) ASGI Django now also supports the `http_methods_to_capture` integration option. This is a configurable tuple of HTTP method verbs that should create a transaction in Sentry. The default is `("CONNECT", "DELETE", "GET", "PATCH", "POST", "PUT", "TRACE",)`. `OPTIONS` and `HEAD` are not included by default. Here's how to use it: ```python sentry_sdk.init( integrations=[ DjangoIntegration( http_methods_to_capture=("GET", "POST"), ), ], ) ``` ##### Miscellaneous - Add 3.13 to setup.py ([#3574](https://redirect.github.com/getsentry/sentry-python/issues/3574)) by [@sentrivana](https://redirect.github.com/sentrivana) - Add 3.13 to basepython ([#3589](https://redirect.github.com/getsentry/sentry-python/issues/3589)) by [@sentrivana](https://redirect.github.com/sentrivana) - Fix type of `sample_rate` in DSC (and add explanatory tests) ([#3603](https://redirect.github.com/getsentry/sentry-python/issues/3603)) by [@antonpirker](https://redirect.github.com/antonpirker) - Add `httpcore` based `HTTP2Transport` ([#3588](https://redirect.github.com/getsentry/sentry-python/issues/3588)) by [@BYK](https://redirect.github.com/BYK) - Add opportunistic Brotli compression ([#3612](https://redirect.github.com/getsentry/sentry-python/issues/3612)) by [@BYK](https://redirect.github.com/BYK) - Add `__notes__` support ([#3620](https://redirect.github.com/getsentry/sentry-python/issues/3620)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Remove useless makefile targets ([#3604](https://redirect.github.com/getsentry/sentry-python/issues/3604)) by [@antonpirker](https://redirect.github.com/antonpirker) - Simplify tox version spec ([#3609](https://redirect.github.com/getsentry/sentry-python/issues/3609)) by [@sentrivana](https://redirect.github.com/sentrivana) - Consolidate contributing docs ([#3606](https://redirect.github.com/getsentry/sentry-python/issues/3606)) by [@antonpirker](https://redirect.github.com/antonpirker) - Bump `codecov/codecov-action` from `4.5.0` to `4.6.0` ([#3617](https://redirect.github.com/getsentry/sentry-python/issues/3617)) by [@dependabot](https://redirect.github.com/dependabot) ### [`v2.15.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2150) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.14.0...2.15.0) ##### Integrations - Configure HTTP methods to capture in ASGI/WSGI middleware and frameworks ([#3531](https://redirect.github.com/getsentry/sentry-python/issues/3531)) by [@antonpirker](https://redirect.github.com/antonpirker) We've added a new option to the Django, Flask, Starlette and FastAPI integrations called `http_methods_to_capture`. This is a configurable tuple of HTTP method verbs that should create a transaction in Sentry. The default is `("CONNECT", "DELETE", "GET", "PATCH", "POST", "PUT", "TRACE",)`. `OPTIONS` and `HEAD` are not included by default. Here's how to use it (substitute Flask for your framework integration): ```python sentry_sdk.init( integrations=[ FlaskIntegration( http_methods_to_capture=("GET", "POST"), ), ], ) ``` - Django: Allow ASGI to use `drf_request` in `DjangoRequestExtractor` ([#3572](https://redirect.github.com/getsentry/sentry-python/issues/3572)) by [@PakawiNz](https://redirect.github.com/PakawiNz) - Django: Don't let `RawPostDataException` bubble up ([#3553](https://redirect.github.com/getsentry/sentry-python/issues/3553)) by [@sentrivana](https://redirect.github.com/sentrivana) - Django: Add `sync_capable` to `SentryWrappingMiddleware` ([#3510](https://redirect.github.com/getsentry/sentry-python/issues/3510)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - AIOHTTP: Add `failed_request_status_codes` ([#3551](https://redirect.github.com/getsentry/sentry-python/issues/3551)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) You can now define a set of integers that will determine which status codes should be reported to Sentry. ```python sentry_sdk.init( integrations=[ AioHttpIntegration( failed_request_status_codes={403, *range(500, 600)}, ) ] ) ``` Examples of valid `failed_request_status_codes`: - `{500}` will only send events on HTTP 500. - `{400, *range(500, 600)}` will send events on HTTP 400 as well as the 5xx range. - `{500, 503}` will send events on HTTP 500 and 503. - `set()` (the empty set) will not send events for any HTTP status code. The default is `{*range(500, 600)}`, meaning that all 5xx status codes are reported to Sentry. - AIOHTTP: Delete test which depends on AIOHTTP behavior ([#3568](https://redirect.github.com/getsentry/sentry-python/issues/3568)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - AIOHTTP: Handle invalid responses ([#3554](https://redirect.github.com/getsentry/sentry-python/issues/3554)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - FastAPI/Starlette: Support new `failed_request_status_codes` ([#3563](https://redirect.github.com/getsentry/sentry-python/issues/3563)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) The format of `failed_request_status_codes` has changed from a list of integers and containers to a set: ```python sentry_sdk.init( integrations=StarletteIntegration( failed_request_status_codes={403, *range(500, 600)}, ), ) ``` The old way of defining `failed_request_status_codes` will continue to work for the time being. Examples of valid new-style `failed_request_status_codes`: - `{500}` will only send events on HTTP 500. - `{400, *range(500, 600)}` will send events on HTTP 400 as well as the 5xx range. - `{500, 503}` will send events on HTTP 500 and 503. - `set()` (the empty set) will not send events for any HTTP status code. The default is `{*range(500, 600)}`, meaning that all 5xx status codes are reported to Sentry. - FastAPI/Starlette: Fix `failed_request_status_codes=[]` ([#3561](https://redirect.github.com/getsentry/sentry-python/issues/3561)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - FastAPI/Starlette: Remove invalid `failed_request_status_code` tests ([#3560](https://redirect.github.com/getsentry/sentry-python/issues/3560)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - FastAPI/Starlette: Refactor shared test parametrization ([#3562](https://redirect.github.com/getsentry/sentry-python/issues/3562)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) ##### Miscellaneous - Deprecate `sentry_sdk.metrics` ([#3512](https://redirect.github.com/getsentry/sentry-python/issues/3512)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Add `name` parameter to `start_span()` and deprecate `description` parameter ([#3524](https://redirect.github.com/getsentry/sentry-python/issues/3524) & [#3525](https://redirect.github.com/getsentry/sentry-python/issues/3525)) by [@antonpirker](https://redirect.github.com/antonpirker) - Fix `add_query_source` with modules outside of project root ([#3313](https://redirect.github.com/getsentry/sentry-python/issues/3313)) by [@rominf](https://redirect.github.com/rominf) - Test more integrations on 3.13 ([#3578](https://redirect.github.com/getsentry/sentry-python/issues/3578)) by [@sentrivana](https://redirect.github.com/sentrivana) - Fix trailing whitespace ([#3579](https://redirect.github.com/getsentry/sentry-python/issues/3579)) by [@sentrivana](https://redirect.github.com/sentrivana) - Improve `get_integration` typing ([#3550](https://redirect.github.com/getsentry/sentry-python/issues/3550)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Make import-related tests stable ([#3548](https://redirect.github.com/getsentry/sentry-python/issues/3548)) by [@BYK](https://redirect.github.com/BYK) - Fix breadcrumb sorting ([#3511](https://redirect.github.com/getsentry/sentry-python/issues/3511)) by [@sentrivana](https://redirect.github.com/sentrivana) - Fix breadcrumb timestamp casting and its tests ([#3546](https://redirect.github.com/getsentry/sentry-python/issues/3546)) by [@BYK](https://redirect.github.com/BYK) - Don't use deprecated `logger.warn` ([#3552](https://redirect.github.com/getsentry/sentry-python/issues/3552)) by [@sentrivana](https://redirect.github.com/sentrivana) - Fix Cohere API change ([#3549](https://redirect.github.com/getsentry/sentry-python/issues/3549)) by [@BYK](https://redirect.github.com/BYK) - Fix deprecation message ([#3536](https://redirect.github.com/getsentry/sentry-python/issues/3536)) by [@antonpirker](https://redirect.github.com/antonpirker) - Remove experimental `explain_plan` feature. ([#3534](https://redirect.github.com/getsentry/sentry-python/issues/3534)) by [@antonpirker](https://redirect.github.com/antonpirker) - X-fail one of the Lambda tests ([#3592](https://redirect.github.com/getsentry/sentry-python/issues/3592)) by [@antonpirker](https://redirect.github.com/antonpirker) - Update Codecov config ([#3507](https://redirect.github.com/getsentry/sentry-python/issues/3507)) by [@antonpirker](https://redirect.github.com/antonpirker) - Update `actions/upload-artifact` to `v4` with merge ([#3545](https://redirect.github.com/getsentry/sentry-python/issues/3545)) by [@joshuarli](https://redirect.github.com/joshuarli) - Bump `actions/checkout` from `4.1.7` to `4.2.0` ([#3585](https://redirect.github.com/getsentry/sentry-python/issues/3585)) by [@dependabot](https://redirect.github.com/dependabot) ### [`v2.14.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2140) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.13.0...2.14.0) ##### Various fixes & improvements - New `SysExitIntegration` ([#3401](https://redirect.github.com/getsentry/sentry-python/issues/3401)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) For more information, see the documentation for the [SysExitIntegration](https://docs.sentry.io/platforms/python/integrations/sys_exit). - Add `SENTRY_SPOTLIGHT` env variable support ([#3443](https://redirect.github.com/getsentry/sentry-python/issues/3443)) by [@BYK](https://redirect.github.com/BYK) - Support Strawberry `0.239.2` ([#3491](https://redirect.github.com/getsentry/sentry-python/issues/3491)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Add separate `pii_denylist` to `EventScrubber` and run it always ([#3463](https://redirect.github.com/getsentry/sentry-python/issues/3463)) by [@sl0thentr0py](https://redirect.github.com/sl0thentr0py) - Celery: Add wrapper for `Celery().send_task` to support behavior as `Task.apply_async` ([#2377](https://redirect.github.com/getsentry/sentry-python/issues/2377)) by [@divaltor](https://redirect.github.com/divaltor) - Django: SentryWrappingMiddleware.**init** fails if super() is object ([#2466](https://redirect.github.com/getsentry/sentry-python/issues/2466)) by [@cameron-simpson](https://redirect.github.com/cameron-simpson) - Fix data_category for sessions envelope items ([#3473](https://redirect.github.com/getsentry/sentry-python/issues/3473)) by [@sl0thentr0py](https://redirect.github.com/sl0thentr0py) - Fix non-UTC timestamps ([#3461](https://redirect.github.com/getsentry/sentry-python/issues/3461)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Remove obsolete object as superclass ([#3480](https://redirect.github.com/getsentry/sentry-python/issues/3480)) by [@sentrivana](https://redirect.github.com/sentrivana) - Replace custom `TYPE_CHECKING` with stdlib `typing.TYPE_CHECKING` ([#3447](https://redirect.github.com/getsentry/sentry-python/issues/3447)) by [@dev-satoshi](https://redirect.github.com/dev-satoshi) - Refactor `tracing_utils.py` ([#3452](https://redirect.github.com/getsentry/sentry-python/issues/3452)) by [@rominf](https://redirect.github.com/rominf) - Explicitly export symbol in subpackages instead of ignoring ([#3400](https://redirect.github.com/getsentry/sentry-python/issues/3400)) by [@hartungstenio](https://redirect.github.com/hartungstenio) - Better test coverage reports ([#3498](https://redirect.github.com/getsentry/sentry-python/issues/3498)) by [@antonpirker](https://redirect.github.com/antonpirker) - Fixed config for old coverage versions ([#3504](https://redirect.github.com/getsentry/sentry-python/issues/3504)) by [@antonpirker](https://redirect.github.com/antonpirker) - Fix AWS Lambda tests ([#3495](https://redirect.github.com/getsentry/sentry-python/issues/3495)) by [@antonpirker](https://redirect.github.com/antonpirker) - Remove broken Bottle tests ([#3505](https://redirect.github.com/getsentry/sentry-python/issues/3505)) by [@sentrivana](https://redirect.github.com/sentrivana) ### [`v2.13.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2130) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.12.0...2.13.0) ##### Various fixes & improvements - **New integration:** [Ray](https://docs.sentry.io/platforms/python/integrations/ray/) ([#2400](https://redirect.github.com/getsentry/sentry-python/issues/2400)) ([#2444](https://redirect.github.com/getsentry/sentry-python/issues/2444)) by [@glowskir](https://redirect.github.com/glowskir) Usage: (add the RayIntegration to your `sentry_sdk.init()` call and make sure it is called in the worker processes) ```python import ray import sentry_sdk from sentry_sdk.integrations.ray import RayIntegration def init_sentry(): sentry_sdk.init( dsn="...", traces_sample_rate=1.0, integrations=[RayIntegration()], ) init_sentry() ray.init( runtime_env=dict(worker_process_setup_hook=init_sentry), ) ``` For more information, see the documentation for the [Ray integration](https://docs.sentry.io/platforms/python/integrations/ray/). - **New integration:** [Litestar](https://docs.sentry.io/platforms/python/integrations/litestar/) ([#2413](https://redirect.github.com/getsentry/sentry-python/issues/2413)) ([#3358](https://redirect.github.com/getsentry/sentry-python/issues/3358)) by [@KellyWalker](https://redirect.github.com/KellyWalker) Usage: (add the LitestarIntegration to your `sentry_sdk.init()`) ```python from litestar import Litestar, get import sentry_sdk from sentry_sdk.integrations.litestar import LitestarIntegration sentry_sdk.init( dsn="...", traces_sample_rate=1.0, integrations=[LitestarIntegration()], ) @get("/") async def index() -> str: return "Hello, world!" app = Litestar(...) ``` For more information, see the documentation for the [Litestar integration](https://docs.sentry.io/platforms/python/integrations/litestar/). - **New integration:** [Dramatiq](https://docs.sentry.io/platforms/python/integrations/dramatiq/) from [@jacobsvante](https://redirect.github.com/jacobsvante) ([#3397](https://redirect.github.com/getsentry/sentry-python/issues/3397)) by [@antonpirker](https://redirect.github.com/antonpirker) Usage: (add the DramatiqIntegration to your `sentry_sdk.init()`) ```python import dramatiq import sentry_sdk from sentry_sdk.integrations.dramatiq import DramatiqIntegration sentry_sdk.init( dsn="...", traces_sample_rate=1.0, integrations=[DramatiqIntegration()], ) @dramatiq.actor(max_retries=0) def dummy_actor(x, y): return x / y dummy_actor.send(12, 0) ``` For more information, see the documentation for the [Dramatiq integration](https://docs.sentry.io/platforms/python/integrations/dramatiq/). - **New config option:** Expose `custom_repr` function that precedes `safe_repr` invocation in serializer ([#3438](https://redirect.github.com/getsentry/sentry-python/issues/3438)) by [@sl0thentr0py](https://redirect.github.com/sl0thentr0py) See: https://docs.sentry.io/platforms/python/configuration/options/#custom-repr - Profiling: Add client SDK info to profile chunk ([#3386](https://redirect.github.com/getsentry/sentry-python/issues/3386)) by [@Zylphrex](https://redirect.github.com/Zylphrex) - Serialize vars early to avoid living references ([#3409](https://redirect.github.com/getsentry/sentry-python/issues/3409)) by [@sl0thentr0py](https://redirect.github.com/sl0thentr0py) - Deprecate hub-based `sessions.py` logic ([#3419](https://redirect.github.com/getsentry/sentry-python/issues/3419)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Deprecate `is_auto_session_tracking_enabled` ([#3428](https://redirect.github.com/getsentry/sentry-python/issues/3428)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Add note to generated yaml files ([#3423](https://redirect.github.com/getsentry/sentry-python/issues/3423)) by [@sentrivana](https://redirect.github.com/sentrivana) - Slim down PR template ([#3382](https://redirect.github.com/getsentry/sentry-python/issues/3382)) by [@sentrivana](https://redirect.github.com/sentrivana) - Use new banner in readme ([#3390](https://redirect.github.com/getsentry/sentry-python/issues/3390)) by [@sentrivana](https://redirect.github.com/sentrivana) ### [`v2.12.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2120) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.11.0...2.12.0) ##### Various fixes & improvements - API: Expose the scope getters to top level API and use them everywhere ([#3357](https://redirect.github.com/getsentry/sentry-python/issues/3357)) by [@sl0thentr0py](https://redirect.github.com/sl0thentr0py) - API: `push_scope` deprecation warning ([#3355](https://redirect.github.com/getsentry/sentry-python/issues/3355)) ([#3355](https://redirect.github.com/getsentry/sentry-python/issues/3355)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - API: Replace `push_scope` ([#3353](https://redirect.github.com/getsentry/sentry-python/issues/3353), [#3354](https://redirect.github.com/getsentry/sentry-python/issues/3354)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - API: Deprecate, avoid, or stop using `configure_scope` ([#3348](https://redirect.github.com/getsentry/sentry-python/issues/3348), [#3349](https://redirect.github.com/getsentry/sentry-python/issues/3349), [#3350](https://redirect.github.com/getsentry/sentry-python/issues/3350), [#3351](https://redirect.github.com/getsentry/sentry-python/issues/3351)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - OTel: Remove experimental autoinstrumentation ([#3239](https://redirect.github.com/getsentry/sentry-python/issues/3239)) by [@sentrivana](https://redirect.github.com/sentrivana) - Graphene: Add span for grapqhl operation ([#2788](https://redirect.github.com/getsentry/sentry-python/issues/2788)) by [@czyber](https://redirect.github.com/czyber) - AI: Add async support for `ai_track` decorator ([#3376](https://redirect.github.com/getsentry/sentry-python/issues/3376)) by [@czyber](https://redirect.github.com/czyber) - CI: Workaround bug preventing Django test runs ([#3371](https://redirect.github.com/getsentry/sentry-python/issues/3371)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - CI: Remove Django setuptools pin ([#3378](https://redirect.github.com/getsentry/sentry-python/issues/3378)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Tests: Test with Django 5.1 RC ([#3370](https://redirect.github.com/getsentry/sentry-python/issues/3370)) by [@sentrivana](https://redirect.github.com/sentrivana) - Broaden `add_attachment` type ([#3342](https://redirect.github.com/getsentry/sentry-python/issues/3342)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Add span data to the transactions trace context ([#3374](https://redirect.github.com/getsentry/sentry-python/issues/3374)) by [@antonpirker](https://redirect.github.com/antonpirker) - Gracefully fail attachment path not found case ([#3337](https://redirect.github.com/getsentry/sentry-python/issues/3337)) by [@sl0thentr0py](https://redirect.github.com/sl0thentr0py) - Document attachment parameters ([#3342](https://redirect.github.com/getsentry/sentry-python/issues/3342)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Bump checkouts/data-schemas from `0feb234` to `6d2c435` ([#3369](https://redirect.github.com/getsentry/sentry-python/issues/3369)) by [@dependabot](https://redirect.github.com/dependabot) - Bump checkouts/data-schemas from `88273a9` to `0feb234` ([#3252](https://redirect.github.com/getsentry/sentry-python/issues/3252)) by [@dependabot](https://redirect.github.com/dependabot) ### [`v2.11.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2110) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.10.0...2.11.0) ##### Various fixes & improvements - Add `disabled_integrations` ([#3328](https://redirect.github.com/getsentry/sentry-python/issues/3328)) by [@sentrivana](https://redirect.github.com/sentrivana) Disabling individual integrations is now much easier. Instead of disabling all automatically enabled integrations and specifying the ones you want to keep, you can now use the new [`disabled_integrations`](https://docs.sentry.io/platforms/python/configuration/options/#auto-enabling-integrations) config option to provide a list of integrations to disable: ```python import sentry_sdk from sentry_sdk.integrations.flask import FlaskIntegration sentry_sdk.init( ``` ### Do not use the Flask integration even if Flask is installed. disabled_integrations=[ FlaskIntegration(), ], ) ``` - Use operation name as transaction name in Strawberry (#3294) by @sentrivana - WSGI integrations respect `SCRIPT_NAME` env variable (#2622) by @sarvaSanjay - Make Django DB spans have origin `auto.db.django` (#3319) by @antonpirker - Sort breadcrumbs by time before sending (#3307) by @antonpirker - Fix `KeyError('sentry-monitor-start-timestamp-s')` (#3278) by @Mohsen-Khodabakhshi - Set MongoDB tags directly on span data (#3290) by @0Calories - Lower logger level for some messages (#3305) by @sentrivana and @antonpirker - Emit deprecation warnings from `Hub` API (#3280) by @szokeasaurusrex - Clarify that `instrumenter` is internal-only (#3299) by @szokeasaurusrex - Support Django 5.1 (#3207) by @sentrivana - Remove apparently unnecessary `if` (#3298) by @szokeasaurusrex - Preliminary support for Python 3.13 (#3200) by @sentrivana - Move `sentry_sdk.init` out of `hub.py` (#3276) by @szokeasaurusrex - Unhardcode integration list (#3240) by @rominf - Allow passing of PostgreSQL port in tests (#3281) by @rominf - Add tests for `@ai_track` decorator (#3325) by @colin-sentry - Do not include type checking code in coverage report (#3327) by @antonpirker - Fix test_installed_modules (#3309) by @szokeasaurusrex - Fix typos and grammar in a comment (#3293) by @szokeasaurusrex - Fixed failed tests setup (#3303) by @antonpirker - Only assert warnings we are interested in (#3314) by @szokeasaurusrex ``` ### [`v2.10.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#2100) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.9.0...2.10.0) ##### Various fixes & improvements - Add client cert and key support to `HttpTransport` ([#3258](https://redirect.github.com/getsentry/sentry-python/issues/3258)) by [@grammy-jiang](https://redirect.github.com/grammy-jiang) Add `cert_file` and `key_file` to your `sentry_sdk.init` to use a custom client cert and key. Alternatively, the environment variables `CLIENT_CERT_FILE` and `CLIENT_KEY_FILE` can be used as well. - OpenAI: Lazy initialize tiktoken to avoid http at import time ([#3287](https://redirect.github.com/getsentry/sentry-python/issues/3287)) by [@colin-sentry](https://redirect.github.com/colin-sentry) - OpenAI, Langchain: Make tiktoken encoding name configurable + tiktoken usage opt-in ([#3289](https://redirect.github.com/getsentry/sentry-python/issues/3289)) by [@colin-sentry](https://redirect.github.com/colin-sentry) Fixed a bug where having certain packages installed along the Sentry SDK caused an HTTP request to be made to OpenAI infrastructure when the Sentry SDK was initialized. The request was made when the `tiktoken` package and at least one of the `openai` or `langchain` packages were installed. The request was fetching a `tiktoken` encoding in order to correctly measure token usage in some OpenAI and Langchain calls. This behavior is now opt-in. The choice of encoding to use was made configurable as well. To opt in, set the `tiktoken_encoding_name` parameter in the OpenAPI or Langchain integration. ```python sentry_sdk.init( integrations=[ OpenAIIntegration(tiktoken_encoding_name="cl100k_base"), LangchainIntegration(tiktoken_encoding_name="cl100k_base"), ], ) ``` - PyMongo: Send query description as valid JSON ([#3291](https://redirect.github.com/getsentry/sentry-python/issues/3291)) by [@0Calories](https://redirect.github.com/0Calories) - Remove Python 2 compatibility code ([#3284](https://redirect.github.com/getsentry/sentry-python/issues/3284)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Fix `sentry_sdk.init` type hint ([#3283](https://redirect.github.com/getsentry/sentry-python/issues/3283)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Deprecate `hub` in `Profile` ([#3270](https://redirect.github.com/getsentry/sentry-python/issues/3270)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Stop using `Hub` in `init` ([#3275](https://redirect.github.com/getsentry/sentry-python/issues/3275)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Delete `_should_send_default_pii` ([#3274](https://redirect.github.com/getsentry/sentry-python/issues/3274)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Remove `Hub` usage in `conftest` ([#3273](https://redirect.github.com/getsentry/sentry-python/issues/3273)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Rename debug logging filter ([#3260](https://redirect.github.com/getsentry/sentry-python/issues/3260)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Update `NoOpSpan.finish` signature ([#3267](https://redirect.github.com/getsentry/sentry-python/issues/3267)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Remove `Hub` in `Transaction.finish` ([#3267](https://redirect.github.com/getsentry/sentry-python/issues/3267)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Remove Hub from `capture_internal_exception` logic ([#3264](https://redirect.github.com/getsentry/sentry-python/issues/3264)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Improve `Scope._capture_internal_exception` type hint ([#3264](https://redirect.github.com/getsentry/sentry-python/issues/3264)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Correct `ExcInfo` type ([#3266](https://redirect.github.com/getsentry/sentry-python/issues/3266)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Stop using `Hub` in `tracing_utils` ([#3269](https://redirect.github.com/getsentry/sentry-python/issues/3269)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) ### [`v2.9.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#290) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.8.0...2.9.0) ##### Various fixes & improvements - ref(transport): Improve event data category typing ([#3243](https://redirect.github.com/getsentry/sentry-python/issues/3243)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - ref(tracing): Improved handling of span status ([#3261](https://redirect.github.com/getsentry/sentry-python/issues/3261)) by [@antonpirker](https://redirect.github.com/antonpirker) - test(client): Add tests for dropped span client reports ([#3244](https://redirect.github.com/getsentry/sentry-python/issues/3244)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - test(transport): Test new client report features ([#3244](https://redirect.github.com/getsentry/sentry-python/issues/3244)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - feat(tracing): Record lost spans in client reports ([#3244](https://redirect.github.com/getsentry/sentry-python/issues/3244)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - test(sampling): Replace custom logic with `capture_record_lost_event_calls` ([#3257](https://redirect.github.com/getsentry/sentry-python/issues/3257)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - test(transport): Non-order-dependent discarded events assertion ([#3255](https://redirect.github.com/getsentry/sentry-python/issues/3255)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - test(core): Introduce `capture_record_lost_event_calls` fixture ([#3254](https://redirect.github.com/getsentry/sentry-python/issues/3254)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - test(core): Fix non-idempotent test ([#3253](https://redirect.github.com/getsentry/sentry-python/issues/3253)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) ### [`v2.8.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#280) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.7.1...2.8.0) ##### Various fixes & improvements - `profiler_id` uses underscore ([#3249](https://redirect.github.com/getsentry/sentry-python/issues/3249)) by [@Zylphrex](https://redirect.github.com/Zylphrex) - Don't send full env to subprocess ([#3251](https://redirect.github.com/getsentry/sentry-python/issues/3251)) by [@kmichel-aiven](https://redirect.github.com/kmichel-aiven) - Stop using `Hub` in `HttpTransport` ([#3247](https://redirect.github.com/getsentry/sentry-python/issues/3247)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Remove `ipdb` from test requirements ([#3237](https://redirect.github.com/getsentry/sentry-python/issues/3237)) by [@rominf](https://redirect.github.com/rominf) - Avoid propagation of empty baggage ([#2968](https://redirect.github.com/getsentry/sentry-python/issues/2968)) by [@hartungstenio](https://redirect.github.com/hartungstenio) - Add entry point for `SentryPropagator` ([#3086](https://redirect.github.com/getsentry/sentry-python/issues/3086)) by [@mender](https://redirect.github.com/mender) - Bump checkouts/data-schemas from `8c13457` to `88273a9` ([#3225](https://redirect.github.com/getsentry/sentry-python/issues/3225)) by [@dependabot](https://redirect.github.com/dependabot) ### [`v2.7.1`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#271) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.7.0...2.7.1) ##### Various fixes & improvements - fix(otel): Fix missing baggage ([#3218](https://redirect.github.com/getsentry/sentry-python/issues/3218)) by [@sentrivana](https://redirect.github.com/sentrivana) - This is the config file of asdf-vm which we do not use. ([#3215](https://redirect.github.com/getsentry/sentry-python/issues/3215)) by [@antonpirker](https://redirect.github.com/antonpirker) - Added option to disable middleware spans in Starlette ([#3052](https://redirect.github.com/getsentry/sentry-python/issues/3052)) by [@antonpirker](https://redirect.github.com/antonpirker) - build: Update tornado version in setup.py to match code check. ([#3206](https://redirect.github.com/getsentry/sentry-python/issues/3206)) by [@aclemons](https://redirect.github.com/aclemons) ### [`v2.7.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#270) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.6.0...2.7.0) - Add `origin` to spans and transactions ([#3133](https://redirect.github.com/getsentry/sentry-python/issues/3133)) by [@antonpirker](https://redirect.github.com/antonpirker) - OTel: Set up typing for OTel ([#3168](https://redirect.github.com/getsentry/sentry-python/issues/3168)) by [@sentrivana](https://redirect.github.com/sentrivana) - OTel: Auto instrumentation skeleton ([#3143](https://redirect.github.com/getsentry/sentry-python/issues/3143)) by [@sentrivana](https://redirect.github.com/sentrivana) - OpenAI: If there is an internal error, still return a value ([#3192](https://redirect.github.com/getsentry/sentry-python/issues/3192)) by [@colin-sentry](https://redirect.github.com/colin-sentry) - MongoDB: Add MongoDB collection span tag ([#3182](https://redirect.github.com/getsentry/sentry-python/issues/3182)) by [@0Calories](https://redirect.github.com/0Calories) - MongoDB: Change span operation from `db.query` to `db` ([#3186](https://redirect.github.com/getsentry/sentry-python/issues/3186)) by [@0Calories](https://redirect.github.com/0Calories) - MongoDB: Remove redundant command name in query description ([#3189](https://redirect.github.com/getsentry/sentry-python/issues/3189)) by [@0Calories](https://redirect.github.com/0Calories) - Apache Spark: Fix spark driver integration ([#3162](https://redirect.github.com/getsentry/sentry-python/issues/3162)) by [@seyoon-lim](https://redirect.github.com/seyoon-lim) - Apache Spark: Add Spark test suite to tox.ini and to CI ([#3199](https://redirect.github.com/getsentry/sentry-python/issues/3199)) by [@sentrivana](https://redirect.github.com/sentrivana) - Codecov: Add failed test commits in PRs ([#3190](https://redirect.github.com/getsentry/sentry-python/issues/3190)) by [@antonpirker](https://redirect.github.com/antonpirker) - Update library, Python versions in tests ([#3202](https://redirect.github.com/getsentry/sentry-python/issues/3202)) by [@sentrivana](https://redirect.github.com/sentrivana) - Remove Hub from our test suite ([#3197](https://redirect.github.com/getsentry/sentry-python/issues/3197)) by [@antonpirker](https://redirect.github.com/antonpirker) - Use env vars for default CA cert bundle location ([#3160](https://redirect.github.com/getsentry/sentry-python/issues/3160)) by [@DragoonAethis](https://redirect.github.com/DragoonAethis) - Create a separate test group for AI ([#3198](https://redirect.github.com/getsentry/sentry-python/issues/3198)) by [@sentrivana](https://redirect.github.com/sentrivana) - Add additional stub packages for type checking ([#3122](https://redirect.github.com/getsentry/sentry-python/issues/3122)) by [@Daverball](https://redirect.github.com/Daverball) - Proper naming of requirements files ([#3191](https://redirect.github.com/getsentry/sentry-python/issues/3191)) by [@antonpirker](https://redirect.github.com/antonpirker) - Pinning pip because new version does not work with some versions of Celery and Httpx ([#3195](https://redirect.github.com/getsentry/sentry-python/issues/3195)) by [@antonpirker](https://redirect.github.com/antonpirker) - build(deps): bump supercharge/redis-github-action from 1.7.0 to 1.8.0 ([#3193](https://redirect.github.com/getsentry/sentry-python/issues/3193)) by [@dependabot](https://redirect.github.com/dependabot) - build(deps): bump actions/checkout from 4.1.6 to 4.1.7 ([#3171](https://redirect.github.com/getsentry/sentry-python/issues/3171)) by [@dependabot](https://redirect.github.com/dependabot) - build(deps): update pytest-asyncio requirement ([#3087](https://redirect.github.com/getsentry/sentry-python/issues/3087)) by [@dependabot](https://redirect.github.com/dependabot) ### [`v2.6.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#260) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.5.1...2.6.0) - Introduce continuous profiling mode ([#2830](https://redirect.github.com/getsentry/sentry-python/issues/2830)) by [@Zylphrex](https://redirect.github.com/Zylphrex) - Profiling: Add deprecation comment for profiler internals ([#3167](https://redirect.github.com/getsentry/sentry-python/issues/3167)) by [@sentrivana](https://redirect.github.com/sentrivana) - Profiling: Move thread data to trace context ([#3157](https://redirect.github.com/getsentry/sentry-python/issues/3157)) by [@Zylphrex](https://redirect.github.com/Zylphrex) - Explicitly export cron symbols for typecheckers ([#3072](https://redirect.github.com/getsentry/sentry-python/issues/3072)) by [@spladug](https://redirect.github.com/spladug) - Cleaning up ASGI tests for Django ([#3180](https://redirect.github.com/getsentry/sentry-python/issues/3180)) by [@antonpirker](https://redirect.github.com/antonpirker) - Celery: Add Celery receive latency ([#3174](https://redirect.github.com/getsentry/sentry-python/issues/3174)) by [@antonpirker](https://redirect.github.com/antonpirker) - Metrics: Update type hints for tag values ([#3156](https://redirect.github.com/getsentry/sentry-python/issues/3156)) by [@elramen](https://redirect.github.com/elramen) - Django: Fix psycopg3 reconnect error ([#3111](https://redirect.github.com/getsentry/sentry-python/issues/3111)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - Tracing: Keep original function signature when decorated ([#3178](https://redirect.github.com/getsentry/sentry-python/issues/3178)) by [@sentrivana](https://redirect.github.com/sentrivana) - Reapply "Refactor the Celery Beat integration ([#3105](https://redirect.github.com/getsentry/sentry-python/issues/3105))" ([#3144](https://redirect.github.com/getsentry/sentry-python/issues/3144)) ([#3175](https://redirect.github.com/getsentry/sentry-python/issues/3175)) by [@antonpirker](https://redirect.github.com/antonpirker) - Added contributor image to readme ([#3183](https://redirect.github.com/getsentry/sentry-python/issues/3183)) by [@antonpirker](https://redirect.github.com/antonpirker) - bump actions/checkout from 4.1.4 to 4.1.6 ([#3147](https://redirect.github.com/getsentry/sentry-python/issues/3147)) by [@dependabot](https://redirect.github.com/dependabot) - bump checkouts/data-schemas from `59f9683` to `8c13457` ([#3146](https://redirect.github.com/getsentry/sentry-python/issues/3146)) by [@dependabot](https://redirect.github.com/dependabot) ### [`v2.5.1`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#251) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.5.0...2.5.1) This change fixes a regression in our cron monitoring feature, which caused cron checkins not to be sent. The regression appears to have been introduced in version 2.4.0. **We recommend that all users, who use Cron monitoring and are currently running sentry-python ≥2.4.0, upgrade to this release as soon as possible!** ##### Other fixes & improvements - feat(tracing): Warn if not-started transaction entered ([#3003](https://redirect.github.com/getsentry/sentry-python/issues/3003)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - test(scope): Ensure `last_event_id` cleared ([#3124](https://redirect.github.com/getsentry/sentry-python/issues/3124)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) - fix(scope): Clear last_event_id on scope clear ([#3124](https://redirect.github.com/getsentry/sentry-python/issues/3124)) by [@szokeasaurusrex](https://redirect.github.com/szokeasaurusrex) ### [`v2.5.0`](https://redirect.github.com/getsentry/sentry-python/blob/HEAD/CHANGELOG.md#250) [Compare Source](https://redirect.github.com/getsentry/sentry-python/compare/2.4.0...2.5.0) ##### Various fixes & improvements - Allow to configure status codes to report to Sentry in Starlette and FastAPI ([#3008](https://redirect.github.com/getsentry/sentry-python/issues/3008)) by [@sentrivana](https://redirect.github.com/sentrivana) By passing a new option to the FastAPI and Starlette integrations, you're now able to configure what status codes should be sent as events to Sentry. Here's how it works: ```python from sentry_sdk.integrations.starlette import StarletteIntegration from sentry_sdk.integrations.fastapi import FastApiIntegration sentry_sdk.init( ``` ### ... integrations=[ StarletteIntegration( failed_request_status_codes=[403, range(500, 599)], ), FastApiIntegration( failed_request_status_codes=[403, range(500, 599)], ), ] )Configuration
📅 Schedule: Branch creation - "before 4am on the first day of the month" in timezone Asia/Singapore, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.