Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

sentry-spring-boot-starter and sentry-graphql v6.28 #2897

Unanswered
ptrnk91 asked this question in Q&A
Discussion options

Hello.

We use in our project:

  • spring-boot-starter-webflux v3.1.2
  • dgs framework 7.3.6
  • graphql-dgs-webflux-starter 7.3.6
  • sentry-spring-boot-starter-jakarta 6.28.0
  • sentry-graphql 6.28.0

We have our own DataFetchingExceptionHandler that catches our domain exceptions like NotFoundException: RuntimeException(), PermissionDeniedException: RuntimeException() etc and throws graphQL errors as a response.

After updating sentry-spring-boot-starter-jakarta and sentry-graphql to 6.28.0, we have some nuances with the error log in sentry, and all our domain exceptions are sent to sentry, which is not entirely unexpected for the application.

How can we update sentry to 6.28 and keep the behavior of 6.27?

Thank you in advance.

You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

Hello @ptrnk91 you could use our filtering mechanisms beforeSend or EventProcessor, see docs. Does that help or would you need a new way of filtering that's specifically tailored toward filtering GraphQL errors? If so, please provide as many details about how you would like to filter as you can.

I've added something to the Changelog of 6.28.0 as well as the docs PR that should be merged soon. Thanks for the feedback 🙏 .

You must be logged in to vote
2 replies
Comment options

@adinauer Thanks for the quick response.

For some reason I don't get into execute for SentryOptions.BeforeSendCallback and process for EventProcessor. I'll try to figure out what is causing this.

As I see you entered some list for ignoring some kind of errors here https://github.com/getsentry/sentry-java/pull/2856/files#diff-7f30ab5c95b8993cd97ba04b4db5f97c5e54ee69cd6926eb940ac4769c634046R41-R46 for internal use.

I think it would be a nice addition to be able to globally specify which types of graphQL errors should completely exclude from logging to make it easier to exclude certain types of errors.
For example something like this

@Configuration
class SentryConfiguration {
 @Bean
 fun sentryInstrumentation() = SentryInstrumentation(..., excludeLoggingErrorTypes = listOf(enumValueThatImplementsErrorClassification))
}
Comment options

I just checked and both beforeSend and EventProcessor are executed for me. Maybe turn on the debug option and try capturing another event and see if that goes through beforeSend / EventProcessor.

Having a List<ErrorClassification> of ignored errors sounds like a good idea. An additional thing to do might be to pass the ErrorClassification in Hint for people not wanting to manually configure SentryInstrumentation when using spring-graphql where we offer auto configuration. This way it might be easier to filter using beforeSend etc.

I've created #2899 to track.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /