|
1 | 1 | # Changelog
|
2 | 2 |
|
| 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 | + |
3 | 98 | ## 2.14.0
|
4 | 99 |
|
5 | 100 | ### Various fixes & improvements
|
|
47 | 142 | init_sentry()
|
48 | 143 |
|
49 | 144 | ray.init(
|
50 |
| - runtime_env=dict(worker_process_setup_hook=init_sentry), |
| 145 | + runtime_env=dict(worker_process_setup_hook=init_sentry), |
51 | 146 | )
|
52 | 147 | ```
|
53 | 148 | For more information, see the documentation for the [Ray integration](https://docs.sentry.io/platforms/python/integrations/ray/).
|
|
99 | 194 | For more information, see the documentation for the [Dramatiq integration](https://docs.sentry.io/platforms/python/integrations/dramatiq/).
|
100 | 195 |
|
101 | 196 | - **New config option:** Expose `custom_repr` function that precedes `safe_repr` invocation in serializer (#3438) by @sl0thentr0py
|
102 |
| - |
| 197 | + |
103 | 198 | See: https://docs.sentry.io/platforms/python/configuration/options/#custom-repr
|
104 | 199 |
|
105 | 200 | - Profiling: Add client SDK info to profile chunk (#3386) by @Zylphrex
|
|
0 commit comments