Skip to content

Commit 239cca2

Browse files
author
getsentry-bot
committed
Merge branch 'release/2.5.0'
2 parents 9227968 + 504e05e commit 239cca2

File tree

4 files changed

+45
-3
lines changed

4 files changed

+45
-3
lines changed

CHANGELOG.md

+42
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
11
# Changelog
22

3+
## 2.5.0
4+
5+
### Various fixes & improvements
6+
7+
- Allow to configure status codes to report to Sentry in Starlette and FastAPI (#3008) by @sentrivana
8+
9+
By passing a new option to the FastAPI and Starlette integrations, you're now able to configure what
10+
status codes should be sent as events to Sentry. Here's how it works:
11+
12+
```python
13+
from sentry_sdk.integrations.starlette import StarletteIntegration
14+
from sentry_sdk.integrations.fastapi import FastApiIntegration
15+
16+
sentry_sdk.init(
17+
# ...
18+
integrations=[
19+
StarletteIntegration(
20+
failed_request_status_codes=[403, range(500, 599)],
21+
),
22+
FastApiIntegration(
23+
failed_request_status_codes=[403, range(500, 599)],
24+
),
25+
]
26+
)
27+
```
28+
29+
`failed_request_status_codes` expects a list of integers or containers (objects that allow membership checks via `in`)
30+
of integers. Examples of valid `failed_request_status_codes`:
31+
32+
- `[500]` will only send events on HTTP 500.
33+
- `[400, range(500, 599)]` will send events on HTTP 400 as well as the 500-599 range.
34+
- `[500, 503]` will send events on HTTP 500 and 503.
35+
36+
The default is `[range(500, 599)]`.
37+
38+
See the [FastAPI](https://docs.sentry.io/platforms/python/integrations/fastapi/) and [Starlette](https://docs.sentry.io/platforms/python/integrations/starlette/) integration docs for more details.
39+
40+
- Support multiple keys with `cache_prefixes` (#3136) by @sentrivana
41+
- Support integer Redis keys (#3132) by @sentrivana
42+
- Update SDK version in CONTRIBUTING.md (#3129) by @sentrivana
43+
- Bump actions/checkout from 4.1.4 to 4.1.5 (#3067) by @dependabot
44+
345
## 2.4.0
446

547
### Various fixes & improvements

docs/conf.py

+1-1
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.4.0"
31+
release = "2.5.0"
3232
version = ".".join(release.split(".")[:2]) # The short X.Y version.
3333

3434

sentry_sdk/consts.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -508,4 +508,4 @@ def _get_default_options():
508508
del _get_default_options
509509

510510

511-
VERSION = "2.4.0"
511+
VERSION = "2.5.0"

setup.py

+1-1
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.4.0",
24+
version="2.5.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)