getsentry / getsentry/sentry-python

Add `failed_request_status_codes` for more web frameworks

Aperta
#3,134 2 commenti 1 reazione 1 assegnatario Rivendicata da @szokeasaurusrex Vedi su GitHub
Feature Python
Lingua principale
Python
Stelle
2.2k
Fork
669
Merge medio
1g 1h
PR unite (30g)
213

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.