getsentry / sentry-python

The official Python SDK for Sentry.io
https://sentry.io/for/python/
MIT License
1.86k stars 483 forks source link

Add `failed_request_status_codes` for more web frameworks #3134

Open sentrivana opened 3 months ago

sentrivana commented 3 months ago

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.

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 list of status code ranges, where a status code range is one of:

The following are examples of valid failed_request_status_codes:

syserr0r commented 3 months ago

Having this feature for the Django integration would be very helpful to us, if possible

szokeasaurusrex commented 3 days ago

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.

We will first implement this feature for any frameworks where we do alert based on status codes, before moving onto frameworks where we capture the exceptions