feat: improve internal error logging for rpc endpoints #6703
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I believe that when internal errors happen in our RPC endpoints, its not currently logged to sentry. This is bc internal errors are caught, translated into error protobufs, and sent back as a 500 response. Since the exceptions are caught they must be logged explicitly, thats what this PR does.
extra, optional:
https://sentry.sentry.io/performance/trace/a8133bb3ddb340deb9dab4dbbf912fe4/?node=txn-7d11c149497d4bd284d4bfe0d9173608&pageEnd=2024-12-28T07%3A43%3A21.936&pageStart=2024-12-27T07%3A43%3A21.936×tamp=1735328601.721
you can see in this error trace that sentry gets a 500 internal error from snuba, but there is no associated snuba error logged