Skip to content

Commit 5080c76

Browse files
author
getsentry-bot
committed
Merge branch 'release/2.15.0'
2 parents 1c64ff7 + 65909ed commit 5080c76

File tree

4 files changed

+100
-5
lines changed

4 files changed

+100
-5
lines changed

CHANGELOG.md

Lines changed: 97 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,100 @@
11
# Changelog
22

3+
## 2.15.0
4+
5+
### Integrations
6+
7+
- Configure HTTP methods to capture in ASGI/WSGI middleware and frameworks (#3531) by @antonpirker
8+
9+
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.
10+
11+
Here's how to use it (substitute Flask for your framework integration):
12+
13+
```python
14+
sentry_sdk.init(
15+
integrations=[
16+
FlaskIntegration(
17+
http_methods_to_capture=("GET", "POST"),
18+
),
19+
],
20+
)
21+
22+
- Django: Allow ASGI to use `drf_request` in `DjangoRequestExtractor` (#3572) by @PakawiNz
23+
- Django: Don't let `RawPostDataException` bubble up (#3553) by @sentrivana
24+
- Django: Add `sync_capable` to `SentryWrappingMiddleware` (#3510) by @szokeasaurusrex
25+
- AIOHTTP: Add `failed_request_status_codes` (#3551) by @szokeasaurusrex
26+
27+
You can now define a set of integers that will determine which status codes
28+
should be reported to Sentry.
29+
30+
```python
31+
sentry_sdk.init(
32+
integrations=[
33+
AioHttpIntegration(
34+
failed_request_status_codes={403, *range(500, 600)},
35+
)
36+
]
37+
)
38+
```
39+
40+
Examples of valid `failed_request_status_codes`:
41+
42+
- `{500}` will only send events on HTTP 500.
43+
- `{400, *range(500, 600)}` will send events on HTTP 400 as well as the 5xx range.
44+
- `{500, 503}` will send events on HTTP 500 and 503.
45+
- `set()` (the empty set) will not send events for any HTTP status code.
46+
47+
The default is `{*range(500, 600)}`, meaning that all 5xx status codes are reported to Sentry.
48+
49+
- AIOHTTP: Delete test which depends on AIOHTTP behavior (#3568) by @szokeasaurusrex
50+
- AIOHTTP: Handle invalid responses (#3554) by @szokeasaurusrex
51+
- FastAPI/Starlette: Support new `failed_request_status_codes` (#3563) by @szokeasaurusrex
52+
53+
The format of `failed_request_status_codes` has changed from a list
54+
of integers and containers to a set:
55+
56+
```python
57+
sentry_sdk.init(
58+
integrations=StarletteIntegration(
59+
failed_request_status_codes={403, *range(500, 600)},
60+
),
61+
)
62+
```
63+
64+
The old way of defining `failed_request_status_codes` will continue to work
65+
for the time being. Examples of valid new-style `failed_request_status_codes`:
66+
67+
- `{500}` will only send events on HTTP 500.
68+
- `{400, *range(500, 600)}` will send events on HTTP 400 as well as the 5xx range.
69+
- `{500, 503}` will send events on HTTP 500 and 503.
70+
- `set()` (the empty set) will not send events for any HTTP status code.
71+
72+
The default is `{*range(500, 600)}`, meaning that all 5xx status codes are reported to Sentry.
73+
74+
- FastAPI/Starlette: Fix `failed_request_status_codes=[]` (#3561) by @szokeasaurusrex
75+
- FastAPI/Starlette: Remove invalid `failed_request_status_code` tests (#3560) by @szokeasaurusrex
76+
- FastAPI/Starlette: Refactor shared test parametrization (#3562) by @szokeasaurusrex
77+
78+
### Miscellaneous
79+
80+
- Deprecate `sentry_sdk.metrics` (#3512) by @szokeasaurusrex
81+
- Add `name` parameter to `start_span()` and deprecate `description` parameter (#3524 & #3525) by @antonpirker
82+
- Fix `add_query_source` with modules outside of project root (#3313) by @rominf
83+
- Test more integrations on 3.13 (#3578) by @sentrivana
84+
- Fix trailing whitespace (#3579) by @sentrivana
85+
- Improve `get_integration` typing (#3550) by @szokeasaurusrex
86+
- Make import-related tests stable (#3548) by @BYK
87+
- Fix breadcrumb sorting (#3511) by @sentrivana
88+
- Fix breadcrumb timestamp casting and its tests (#3546) by @BYK
89+
- Don't use deprecated `logger.warn` (#3552) by @sentrivana
90+
- Fix Cohere API change (#3549) by @BYK
91+
- Fix deprecation message (#3536) by @antonpirker
92+
- Remove experimental `explain_plan` feature. (#3534) by @antonpirker
93+
- X-fail one of the Lambda tests (#3592) by @antonpirker
94+
- Update Codecov config (#3507) by @antonpirker
95+
- Update `actions/upload-artifact` to `v4` with merge (#3545) by @joshuarli
96+
- Bump `actions/checkout` from `4.1.7` to `4.2.0` (#3585) by @dependabot
97+
398
## 2.14.0
499

5100
### Various fixes & improvements
@@ -47,7 +142,7 @@
47142
init_sentry()
48143

49144
ray.init(
50-
runtime_env=dict(worker_process_setup_hook=init_sentry),
145+
runtime_env=dict(worker_process_setup_hook=init_sentry),
51146
)
52147
```
53148
For more information, see the documentation for the [Ray integration](https://docs.sentry.io/platforms/python/integrations/ray/).
@@ -99,7 +194,7 @@
99194
For more information, see the documentation for the [Dramatiq integration](https://docs.sentry.io/platforms/python/integrations/dramatiq/).
100195

101196
- **New config option:** Expose `custom_repr` function that precedes `safe_repr` invocation in serializer (#3438) by @sl0thentr0py
102-
197+
103198
See: https://docs.sentry.io/platforms/python/configuration/options/#custom-repr
104199

105200
- Profiling: Add client SDK info to profile chunk (#3386) by @Zylphrex

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
copyright = "2019-{}, Sentry Team and Contributors".format(datetime.now().year)
2929
author = "Sentry Team and Contributors"
3030

31-
release = "2.14.0"
31+
release = "2.15.0"
3232
version = ".".join(release.split(".")[:2]) # The short X.Y version.
3333

3434

sentry_sdk/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,4 +566,4 @@ def _get_default_options():
566566
del _get_default_options
567567

568568

569-
VERSION = "2.14.0"
569+
VERSION = "2.15.0"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def get_file_text(file_name):
2121

2222
setup(
2323
name="sentry-sdk",
24-
version="2.14.0",
24+
version="2.15.0",
2525
author="Sentry Team and Contributors",
2626
author_email="[email protected]",
2727
url="https://github.com/getsentry/sentry-python",

0 commit comments

Comments
 (0)