getsentry/sentry-python (sentry-sdk)
### [`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)
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
🧙 Sourcery has finished reviewing your pull request!
Tips and commands
#### Interacting with Sourcery
- **Trigger a new review:** Comment `@sourcery-ai review` on the pull request.
- **Continue discussions:** Reply directly to Sourcery's review comments.
- **Generate a GitHub issue from a review comment:** Ask Sourcery to create an
issue from a review comment by replying to it.
- **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull
request title to generate a title at any time.
- **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in
the pull request body to generate a PR summary at any time. You can also use
this command to specify where the summary should be inserted.
#### Customizing Your Experience
Access your [dashboard](https://app.sourcery.ai) to:
- Enable or disable review features such as the Sourcery-generated pull request
summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
#### Getting Help
- [Contact our support team](mailto:support@sourcery.ai) for questions or feedback.
- Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information.
- Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).
This PR contains the following updates:
2.15.0
->2.16.0
Release Notes
getsentry/sentry-python (sentry-sdk)
### [`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)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.