Make async gRPC less noisy#2507
Conversation
|
Hey @jyggen, thank you for the contribution! ❤️ Not super familiar with gRPC so please bear with me: according to the docs If I look at this from an HTTP API point of view, on the server side I wouldn't be interested in client errors, but anything 500+ I'd like to have reported by Sentry. Is there an equivalent to this in gRPC? |
Comparing what this does in a web framework like aiohttp, it looks like it should just set the status_code of the transaction? sentry-python/sentry_sdk/integrations/aiohttp.py Lines 130 to 132 in 0c9803a From a user perspective, if I explicitly return/raise a response with a given status, then that is expected behaviour which I wouldn't expect to be logged. If I wanted to log such a response as a warning or something, I'd add a log call. |
|
Gotcha @Dreamsorcerer, makes sense to me. |
The new aio integration for gRPC creates new Sentry events for each and every exception raised by the server. This becomes a problem if the user's server code uses
context.abort()(like mine does!). From the documentation:Imagine this server code:
AbortErroris raised fromawait context.abort()every time a user is not found which, with the new Sentry integration, will also send an error event to Sentry every time a user is not found. This is comparable to sending an error to Sentry for every 404 (or any status code really) that your HTTP API returns, aka. probably not something you want to do :)This PR fixes that by simply catching
AbortErrorseparately.