|
1 | 1 | # Changelog
|
2 | 2 |
|
| 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 | + |
3 | 45 | ## 2.4.0
|
4 | 46 |
|
5 | 47 | ### Various fixes & improvements
|
|
0 commit comments