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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow filtering graphql errors #2967

Merged
merged 4 commits into from
Oct 11, 2023
Merged

Allow filtering graphql errors #2967

merged 4 commits into from
Oct 11, 2023

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Oct 5, 2023

馃摐 Description

Allow users to privde a List<String> to filter out certain GraphQL errors. Decided to use String instead of a specific type as String can easily be set in config files.

馃挕 Motivation and Context

Closes #2899

馃挌 How did you test it?

Manually + unit tests

馃摑 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

馃敭 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Messages
馃摉 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 馃毇 dangerJS against 20077ab

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Performance metrics 馃殌

Plain With Sentry Diff
Startup time 372.28 ms 433.64 ms 61.36 ms
Size 1.72 MiB 2.29 MiB 576.49 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
99a51e2 405.11 ms 479.65 ms 74.54 ms

App size

Revision Plain With Sentry Diff
99a51e2 1.72 MiB 2.29 MiB 576.34 KiB

Previous results on branch: feat/graphql-error-filter

Startup times

Revision Plain With Sentry Diff
0605b38 390.90 ms 461.90 ms 71.00 ms
de57c5f 358.23 ms 413.18 ms 54.95 ms

App size

Revision Plain With Sentry Diff
0605b38 1.72 MiB 2.29 MiB 576.49 KiB
de57c5f 1.72 MiB 2.29 MiB 576.34 KiB

@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

Attention: 37 lines in your changes are missing coverage. Please review.

Files Coverage 螖
...y/spring/boot/jakarta/SentryAutoConfiguration.java 97.33% <酶> (酶)
...io/sentry/spring/boot/SentryAutoConfiguration.java 97.33% <酶> (酶)
.../java/io/sentry/graphql/SentryInstrumentation.java 69.93% <66.66%> (-0.82%) 猬囷笍
...o/sentry/spring/boot/jakarta/SentryProperties.java 67.92% <33.33%> (-7.08%) 猬囷笍
...n/java/io/sentry/spring/boot/SentryProperties.java 67.50% <33.33%> (-9.92%) 猬囷笍
...akarta/graphql/SentryGraphqlAutoConfiguration.java 0.00% <0.00%> (酶)
...g/boot/graphql/SentryGraphqlAutoConfiguration.java 0.00% <0.00%> (酶)

馃摙 Thoughts on this report? Let us know!.

Copy link
Collaborator

@lbloder lbloder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(m) Should we add an usage example to the spring-boot samples? i.e. just add a list of ignored error types to the properties file

Good Job 馃憤

@@ -164,7 +164,7 @@ static class OpenTelemetryLinkErrorEventProcessorConfiguration {
}

@Configuration(proxyBeanMethods = false)
@Import(SentryGraphqlConfiguration.class)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the SentryGraphqlConfiguration class be deleted, or is it still of use?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason why we didn't update the SentryGraphqlConfiguration class directly?
What does it change for someone manually using the SentryGraphqlConfiguration?
genuinely asking as i'm not so much into backend

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept sentry-spring/SentryGraphqlConfiguration for people using Spring (not Boot) and I wasn't able to update because SentryProperties lives in sentry-spring-boot so I decided to simply duplicate the config and use the one in sentry-spring-boot for auto config of Spring Boot. LMK if you can think of a simpler way to achieve what we want.

@adinauer adinauer merged commit 7e47940 into main Oct 11, 2023
19 of 21 checks passed
@adinauer adinauer deleted the feat/graphql-error-filter branch October 11, 2023 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Easier way of filtering errors for GraphQL
3 participants