Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aiohttp): Add failed_request_status_codes #3551

Open
wants to merge 1 commit into
base: szokeasaurusrex/aiohttp-bugfix
Choose a base branch
from

Conversation

szokeasaurusrex
Copy link
Member

@szokeasaurusrex szokeasaurusrex commented Sep 20, 2024

failed_request_status_codes allows users to specify the status codes, whose corresponding HTTPException types, should be reported to Sentry. By default, these include 5xx statuses, which is a change from the previous default behavior, where no HTTPExceptions would be reported to Sentry.

The status codes are only captured as errors if they are returned by raising an HTTPException. If a response with one of the failed_request_status_codes is returned, we would not report this to Sentry, as there is no exception object we can send and no easy way to create one.

Closes #3535

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.52%. Comparing base (8935b9b) to head (4558c9a).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sentry_sdk/integrations/aiohttp.py 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                        Coverage Diff                         @@
##           szokeasaurusrex/aiohttp-bugfix    #3551      +/-   ##
==================================================================
- Coverage                           84.53%   84.52%   -0.01%     
==================================================================
  Files                                 133      133              
  Lines                               13841    13846       +5     
  Branches                             2927     2928       +1     
==================================================================
+ Hits                                11700    11703       +3     
  Misses                               1415     1415              
- Partials                              726      728       +2     
Files with missing lines Coverage Δ
sentry_sdk/integrations/aiohttp.py 85.97% <85.71%> (+0.44%) ⬆️

... and 2 files with indirect coverage changes

@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/aiohttp-failed_request_status_codes branch from 2adb74e to 3ad9fa9 Compare September 20, 2024 12:40
@szokeasaurusrex szokeasaurusrex marked this pull request as ready for review September 20, 2024 12:53
@szokeasaurusrex szokeasaurusrex marked this pull request as draft September 20, 2024 13:45
`failed_request_status_codes` allows users to specify the status codes, whose corresponding `HTTPException` types, should be reported to Sentry. By default, these include 5xx statuses, which is a change from the previous default behavior, where no `HTTPException`s would be reported to Sentry.

Closes #3535
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/aiohttp-failed_request_status_codes branch from 3ad9fa9 to 4558c9a Compare September 20, 2024 15:45
@szokeasaurusrex szokeasaurusrex changed the base branch from master to szokeasaurusrex/aiohttp-bugfix September 20, 2024 15:45
@szokeasaurusrex szokeasaurusrex marked this pull request as ready for review September 20, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AioHttp failed_request_status_codes
1 participant