Skip to content

Commit 504e05e

Browse files
authored
Update CHANGELOG.md
1 parent dbc02e6 commit 504e05e

File tree

1 file changed

+36
-4
lines changed

1 file changed

+36
-4
lines changed

CHANGELOG.md

+36-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,43 @@
44

55
### Various fixes & improvements
66

7-
- feat(starlette): Allow to configure status codes to report to Sentry (#3008) by @sentrivana
8-
- fix(redis): Support multiple keys with cache_prefixes (#3136) by @sentrivana
9-
- fix(cache): Fix key_as_string (#3132) by @sentrivana
10-
- build(deps): bump actions/checkout from 4.1.4 to 4.1.5 (#3067) by @dependabot
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
1142
- Update SDK version in CONTRIBUTING.md (#3129) by @sentrivana
43+
- Bump actions/checkout from 4.1.4 to 4.1.5 (#3067) by @dependabot
1244

1345
## 2.4.0
1446

0 commit comments

Comments
 (0)