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

Attach Trace Context when an ANR is detected (ANRv1) #2583

Merged
merged 14 commits into from
Apr 4, 2023

Conversation

markushi
Copy link
Member

@markushi markushi commented Mar 3, 2023

📜 Description

This draft PR

  • improves the accuracy of detecting ANRs
  • Aborts ongoing transactions and links them to ANR events

💡 Motivation and Context

Link transactions and ANRs to get more insights (suspect spans, profiles, etc...)

💚 How did you test it?

Added 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 3, 2023

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

Generated by 🚫 dangerJS against 664f1f3

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2023

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 287.88 ms 334.47 ms 46.59 ms
Size 1.73 MiB 2.27 MiB 551.70 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d81684e 235.73 ms 328.76 ms 93.03 ms
33c80c7 318.88 ms 348.14 ms 29.26 ms
17ab223 427.65 ms 484.31 ms 56.65 ms
33c80c7 331.94 ms 370.54 ms 38.60 ms

App size

Revision Plain With Sentry Diff
d81684e 1.73 MiB 2.26 MiB 547.78 KiB
33c80c7 1.73 MiB 2.26 MiB 551.46 KiB
17ab223 1.73 MiB 2.34 MiB 626.85 KiB
33c80c7 1.73 MiB 2.26 MiB 551.46 KiB

Previous results on branch: feat/anr-v1-attach-tracecontext

Startup times

Revision Plain With Sentry Diff
70b22cf 316.90 ms 322.96 ms 6.06 ms
77ddf1d 358.00 ms 455.84 ms 97.84 ms
33d8a76 276.15 ms 338.20 ms 62.05 ms
9f2ef3c 329.62 ms 386.44 ms 56.82 ms
a195319 290.48 ms 333.10 ms 42.62 ms
7b41497 378.72 ms 412.17 ms 33.45 ms
8b64f09 341.33 ms 389.34 ms 48.01 ms

App size

Revision Plain With Sentry Diff
70b22cf 1.73 MiB 2.26 MiB 551.51 KiB
77ddf1d 1.73 MiB 2.26 MiB 551.54 KiB
33d8a76 1.73 MiB 2.27 MiB 551.62 KiB
9f2ef3c 1.73 MiB 2.26 MiB 551.57 KiB
a195319 1.73 MiB 2.34 MiB 626.46 KiB
7b41497 1.73 MiB 2.26 MiB 551.51 KiB
8b64f09 1.73 MiB 2.34 MiB 626.41 KiB

@markushi markushi changed the title Improve ANRv1 Attach Trace Context when an ANR is detected (ANRv1) Mar 31, 2023
@markushi markushi marked this pull request as ready for review March 31, 2023 09:13
@codecov
Copy link

codecov bot commented Apr 3, 2023

Codecov Report

Patch coverage: 95.77% and project coverage change: +0.01 🎉

Comparison is base (b6c2161) 81.37% compared to head (664f1f3) 81.39%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2583      +/-   ##
============================================
+ Coverage     81.37%   81.39%   +0.01%     
- Complexity     4222     4231       +9     
============================================
  Files           337      337              
  Lines         15602    15622      +20     
  Branches       2037     2041       +4     
============================================
+ Hits          12696    12715      +19     
- Misses         2111     2112       +1     
  Partials        795      795              
Impacted Files Coverage Δ
...entry/src/main/java/io/sentry/NoOpTransaction.java 25.00% <0.00%> (-1.09%) ⬇️
sentry/src/main/java/io/sentry/SentryTracer.java 94.42% <98.43%> (+0.28%) ⬆️
sentry/src/main/java/io/sentry/SentryClient.java 87.10% <100.00%> (+0.15%) ⬆️

... and 1 file with indirect coverage changes

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.

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this 🚀 as discussed internally let's try to finish the scope tx via hints so we can make it work for uncaught exceptions as well

@markushi markushi merged commit de453e7 into main Apr 4, 2023
@markushi markushi deleted the feat/anr-v1-attach-tracecontext branch April 4, 2023 11:19
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.

2 participants