Skip to content

Conversation

@bbelyeu
Copy link
Contributor

@bbelyeu bbelyeu commented Aug 20, 2020

AIOHTTP uses some exceptions to indicate successful responses. We frequently use this for 204 / No Content APIs.

These 204s are currently showing in Instana as "Erroneous Calls", but they aren't our APIs perspective.

See https://docs.aiohttp.org/en/latest/web_exceptions.html#successful-exceptions

so they are not input as errors
except aiohttp.web.HTTPException as e:
# AIOHTTP uses exceptions for specific responses
# see https://docs.aiohttp.org/en/latest/web_exceptions.html#web-server-exceptions
response = e
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In AIOHTTP their exception objects have the status & headers attributes just like the response objects (same interface) so this shouldn't break the lines below. https://docs.aiohttp.org/en/latest/web_exceptions.html#base-http-exception

@pglombardo
Copy link
Contributor

Thanks @bbelyeu - excellent contrib.

@pglombardo pglombardo merged commit 97965e0 into instana:master Aug 24, 2020
@pglombardo pglombardo changed the title Don't count successful responses as errors AIOHTTP: Don't count successful responses as errors Aug 24, 2020
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.

2 participants