getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.87k stars 1.55k forks source link

Filter all RpcExceptions in @sentry/nestjs #13190

Closed pesix closed 1 month ago

pesix commented 1 month ago

Problem Statement

We use gRPC to communicate between microservices written in NestJs (see: https://docs.nestjs.com/microservices/grpc). Similar to HTTP communication, we explicitly throw RpcExceptions with a status code for different types of handled exceptions. Since these are not unexpected exceptions, they should not be captured by Sentry.

Solution Brainstorm

Similar to filtering HttpExceptions (https://github.com/getsentry/sentry-javascript/issues/13064), it would be advisable to filter out RpcExceptions as well, because they are thrown explicitly (see: https://docs.nestjs.com/microservices/exception-filters).

nicohrubec commented 1 month ago

Hey, thanks for writing in! This definitely makes sense. I have added the issue to the nest tracking issue and will try to have a look in the coming weeks.

nicohrubec commented 1 month ago

Hey, about to merge a PR to address this issue. Should go out with the next release some time this or next week probably.