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

No longer send event / transaction to Sentry if beforeSend / beforeSendTransaction throws #2591

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Mar 7, 2023

📜 Description

If an exception occurs in beforeSend or beforeSendTransaction we no longer send the event / transaction to Sentry.

💡 Motivation and Context

Closes #2280 as we no longer want to send an event / transaction in case beforeSend / beforeSendTransaction throws. The reason is that these callbacks are commonly used to filter data before sending to Sentry. In case this filtering logic fails we prefer to not send the event as it may contain sensitive data that was not meant to be sent to Sentry. This also aligns with other Sentry SDKs.

💚 How did you test it?

Updated 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 Mar 7, 2023

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 349.79 ms 374.74 ms 24.95 ms
Size 1.73 MiB 2.34 MiB 626.46 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
7c199d8 323.18 ms 391.33 ms 68.15 ms
7c33bc1 329.67 ms 413.32 ms 83.65 ms
7c33bc1 413.94 ms 432.41 ms 18.47 ms

App size

Revision Plain With Sentry Diff
7c199d8 1.73 MiB 2.34 MiB 626.23 KiB
7c33bc1 1.73 MiB 2.34 MiB 626.25 KiB
7c33bc1 1.73 MiB 2.34 MiB 626.25 KiB

Previous results on branch: fix/do-not-send-error-or-transaction-in-case-of-error-in-before-send

Startup times

Revision Plain With Sentry Diff
44e07c7 320.20 ms 368.46 ms 48.26 ms
68a6f57 345.22 ms 403.61 ms 58.39 ms
95f1d9a 345.61 ms 385.86 ms 40.25 ms

App size

Revision Plain With Sentry Diff
44e07c7 1.73 MiB 2.34 MiB 626.18 KiB
68a6f57 1.73 MiB 2.34 MiB 626.18 KiB
95f1d9a 1.73 MiB 2.34 MiB 626.18 KiB

@codecov
Copy link

codecov bot commented Mar 7, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (4cb1814) 81.15% compared to head (5894e75) 81.14%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2591      +/-   ##
============================================
- Coverage     81.15%   81.14%   -0.01%     
  Complexity     4096     4096              
============================================
  Files           333      333              
  Lines         15205    15193      -12     
  Branches       1982     1980       -2     
============================================
- Hits          12339    12329      -10     
  Misses         2084     2084              
+ Partials        782      780       -2     
Impacted Files Coverage Δ
sentry/src/main/java/io/sentry/SentryClient.java 86.94% <100.00%> (+0.10%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@adinauer adinauer merged commit 3a20d40 into main Mar 10, 2023
@adinauer adinauer deleted the fix/do-not-send-error-or-transaction-in-case-of-error-in-before-send branch March 10, 2023 16:11
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.

Add the name of the exception to the beforeSend callback failed breadcrumb.
2 participants