getsentry/sentry-python (sentry-sdk)
### [`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)
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), 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:
2.14.0
->2.18.0
Release Notes
getsentry/sentry-python (sentry-sdk)
### [`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)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), 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.