Hi,
Description
We are faced with a strange number of the 500 errors in our metrics (which are collected by aiodogstatsd.contrib.aiohttp middleware) and that number was different from what we at ALB logs. The reason for this - is that when the connection is aborted before we processed it, the CancelledError would be raised -- and it will be counted as a 500 error, but this is not true -- user will not receive any response in that case.
Expected behavior
In the case of CancelledError it would be great to have the option to separate it from other errors and have an option to skip it from the metrics
try:
response = await handler(request)
response_status = response.status
except web.HTTPException as e:
response_status = e.status
raise e
except CancelledError:
response_status = ... # some code, that will indicate that is `CancelledError`
finally:
if _proceed_collecting(..., collect_canceled=True/False): # allow to mute CancelledError metric
...
Hi,
Description
We are faced with a strange number of the
500 errorsin our metrics (which are collected byaiodogstatsd.contrib.aiohttpmiddleware) and that number was different from what we at ALB logs. The reason for this - is that when the connection is aborted before we processed it, theCancelledErrorwould be raised -- and it will be counted as a 500 error, but this is not true -- user will not receive any response in that case.Expected behavior
In the case of
CancelledErrorit would be great to have the option to separate it from other errors and have an option to skip it from the metrics