Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: sentry-spring only notifying for exceptions that result in 5xx response #681

Closed
kilink opened this issue Feb 8, 2019 · 6 comments
Labels
enhancement New feature or request Spring Spring
Milestone

Comments

@kilink
Copy link

kilink commented Feb 8, 2019

It would be great if there were a mechanism to only forward exceptions that resulted in a 5xx HTTP response when using the sentry-spring integration.

For instance, I may have a Spring ExceptionHandler registered that maps an Exception to a "400 Bad Request" or "404 Not Found" response, and I don't really care about seeing such errors in Sentry.

Other people seem to have requested a mechanism for filtering out specific exception types, and I get that I could do that same by adding a ShouldSendEventCallback that filters out unwanted exceptions, but that can become burdensome since it requires me to enumerate and understand all of the exceptions that may be mapped back to non-5xx repsonses.

@marandaneto
Copy link
Contributor

@maciejwalkowiak is there a way to do that on v3?

@maciejwalkowiak
Copy link
Contributor

We can make it configurable in Spring Boot integration - users could decide if they want SentryExceptionResolver to run with the highest priority (turn exceptions into events before any other exception handler is triggered) or with the lowest priority - turn only those exceptions into events that have not been caught by other exception handlers.

@maciejwalkowiak maciejwalkowiak added this to the 3.1 milestone Oct 1, 2020
@bruno-garcia
Copy link
Member

Could we expose a callback in the spring integration called shouldCapture where we pass the HTTP request data and the user code can inspect (like status code) and return true/false (or more data if relevant)?

@timtebeek
Copy link
Contributor

Should @kilink / anyone else watching this issue wish to weigh in: there's now a pull request that might fix this issue: #1008

@marandaneto marandaneto added enhancement New feature or request and removed question labels Nov 16, 2020
marandaneto added a commit that referenced this issue Nov 16, 2020
Co-authored-by: Maciej Walkowiak <[email protected]>
Co-authored-by: Manoel Aranda Neto <[email protected]>
Co-authored-by: Manoel Aranda Neto <[email protected]>
@marandaneto
Copy link
Contributor

this is going to be released in the next version, please give it a try :)

@marandaneto
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Spring Spring
Projects
None yet
Development

No branches or pull requests

5 participants