getsentry / getsentry/sentry-python

Add `failed_request_status_codes` for more web frameworks

未關閉
#3,134 2 則留言 1 個 reaction 已指派 1 人 已被 @szokeasaurusrex 認領 在 GitHub 檢視
Feature Python
主要語言
Python
星號
2.2k
分支
669
平均合併
1 天 40 分鐘
30 天內合併 PR
212

描述

We started supporting `failed_request_status_code` for Starlette/FastAPI in https://github.com/getsentry/sentry-python/pull/3008. We should add the option to other web frameworks as well.

- [x] Django
- [ ] Flask
- [x] FastAPI
- [x] #3535
- [x] #3576
- [ ] Falcon
- [ ] Pyramid
- [ ] Quart
- [ ] Sanic
- [x] Starlette
- [x] [Litestar](https://github.com/getsentry/sentry-python/pull/4021)
- [ ] Tornado

Note that this might be tricky since we don't alert based on status codes in some frameworks, but rather internal exceptions happening in request handlers.

### Failed request status codes

`failed_request_status_codes` is a set of status codes. Examples:

- `{500}` will only send events on HTTP 500.
- `{400, *range(500, 600)}` will send events on HTTP 400 as well as the 5xx range.
- `{500, 503}` will send events on HTTP 500 and 503.
- `set()` (the empty set) will not send events for any HTTP status code.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。