Skip to content

Conversation

stj
Copy link
Contributor

@stj stj commented Nov 6, 2021

What does this pull request do?

In aiohttp HTTPExceptions inherit from Response and can have a status
that is < 500. It even has a HTTPOk exception with a 200 status code
that can be raised.

Capturing these exceptions as errors in APM creates a fall's view of
response and service health.

This changes the aiohttp middleware to handle HTTPExceptions different
from other exceptions. It only captures HTTPExceptions equal or above a
500 status and handles all others like a success.

In aiohttp HTTPExceptions inherit from Response and can have a status that is not 500. It even has a HTTPOk exception with a 200 status code that can be raised. Capturing these exception as errors in APM creates a falls view of response and service health. This changes the aiohttp middleware to handle HTTPExceptions different from other exceptions. It only captures HTTPExceptions equal or above a 500 status and handles all others like a success.
@stj stj self-assigned this Nov 6, 2021
@github-actions github-actions bot added agent-python community Issues opened by the community triage Issues awaiting triage labels Nov 6, 2021
@ghost
Copy link

ghost commented Nov 6, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-11-08T19:00:21.227+0000

  • Duration: 32 min 2 sec

  • Commit: 51a8051

Test stats 🧪

Test Results
Failed 0
Passed 10183
Skipped 8977
Total 19160

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.
Copy link
Contributor

@beniwohli beniwohli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, thanks for the PR!

Copy link
Contributor

@basepi basepi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks!

@basepi
Copy link
Contributor

basepi commented Nov 8, 2021

/test

@beniwohli beniwohli merged commit 223c9c1 into elastic:master Nov 9, 2021
@stj stj deleted the better-handle-of-aiohttp-exceptions branch November 9, 2021 13:23
@cachedout cachedout mentioned this pull request Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-python community Issues opened by the community triage Issues awaiting triage
4 participants