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

Fix Automatic UI transactions having wrong durations #2623

Merged
merged 2 commits into from
Mar 28, 2023

Conversation

stefanosiano
Copy link
Member

📜 Description

Automatic Activity transactions now have the ttid start timestamp if appStart span is not present
Span now trims for all transaction children if it's the root span of the transaction

💡 Motivation and Context

The reported duration of the transaction is wrong.

💚 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

…not appStart span is present

Span now trims for all transaction children if it's the root span of the transaction
@stefanosiano stefanosiano marked this pull request as ready for review March 24, 2023 17:34
@github-actions
Copy link
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 326.45 ms 379.51 ms 53.06 ms
Size 1.73 MiB 2.26 MiB 548.10 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d81684e 235.73 ms 328.76 ms 93.03 ms

App size

Revision Plain With Sentry Diff
d81684e 1.73 MiB 2.26 MiB 547.78 KiB

@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

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

Comparison is base (d81684e) 81.31% compared to head (0ba5520) 81.32%.

❗ Current head 0ba5520 differs from pull request most recent head 621e4b1. Consider uploading reports for the commit 621e4b1 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2623      +/-   ##
============================================
+ Coverage     81.31%   81.32%   +0.01%     
- Complexity     4187     4192       +5     
============================================
  Files           336      336              
  Lines         15485    15489       +4     
  Branches       2020     2021       +1     
============================================
+ Hits          12591    12597       +6     
+ Misses         2101     2099       -2     
  Partials        793      793              
Impacted Files Coverage Δ
sentry/src/main/java/io/sentry/SentryTracer.java 94.14% <ø> (+0.78%) ⬆️
...main/java/io/sentry/protocol/MeasurementValue.java 94.23% <ø> (ø)
sentry/src/main/java/io/sentry/NoOpSpan.java 25.00% <100.00%> (+2.41%) ⬆️
...entry/src/main/java/io/sentry/NoOpTransaction.java 24.44% <100.00%> (+1.71%) ⬆️
sentry/src/main/java/io/sentry/Span.java 89.70% <100.00%> (+0.15%) ⬆️

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

@markushi markushi left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -193,7 +193,12 @@ public void finish(final @Nullable SpanStatus status, final @Nullable SentryDate
@Nullable SentryDate minChildStart = null;
@Nullable SentryDate maxChildEnd = null;

final @NotNull List<Span> children = getChildren();
// The root span should be trimmed based on all children, but the other spans, like the
Copy link
Member

Choose a reason for hiding this comment

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

love this, explains the "why" really good and will make it easier to re-iterate over this in future.

@stefanosiano stefanosiano merged commit 986d057 into main Mar 28, 2023
@stefanosiano stefanosiano deleted the fix/auto-transactions-wrong-duration branch March 28, 2023 07:39
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