Skip to content

Add deadline timeout for automatic transactions#2865

Merged
markushi merged 8 commits into
feat/7.0.0from
feat/deadline-for-automatic-ui-transactions
Aug 8, 2023
Merged

Add deadline timeout for automatic transactions#2865
markushi merged 8 commits into
feat/7.0.0from
feat/deadline-for-automatic-ui-transactions

Conversation

@markushi

Copy link
Copy Markdown
Member

📜 Description

Adds a timeout of 30s to automatic UI transactions.
Inspired by cocoa: https://github.com/getsentry/sentry-cocoa/blob/a176fc448cf5f3ea7b188449b8170b14ce6805cf/Sources/Sentry/SentryTracer.m#L248-L266

💡 Motivation and Context

Fixes #2514

💚 How did you test it?

📝 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

github-actions Bot commented Jul 25, 2023

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

Generated by 🚫 dangerJS against 61f011b

Comment thread sentry/src/main/java/io/sentry/TransactionOptions.java
@github-actions

github-actions Bot commented Jul 25, 2023

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 342.71 ms 378.96 ms 36.25 ms
Size 1.72 MiB 2.29 MiB 576.28 KiB

Previous results on branch: feat/deadline-for-automatic-ui-transactions

Startup times

Revision Plain With Sentry Diff
8bbad89 294.88 ms 322.45 ms 27.57 ms
68087ab 278.39 ms 323.38 ms 44.99 ms
7adb6ab 266.60 ms 361.14 ms 94.55 ms
f2cbdf1 309.78 ms 356.22 ms 46.44 ms
c5d4e44 322.10 ms 375.86 ms 53.76 ms

App size

Revision Plain With Sentry Diff
8bbad89 1.72 MiB 2.29 MiB 576.09 KiB
68087ab 1.72 MiB 2.29 MiB 575.53 KiB
7adb6ab 1.72 MiB 2.29 MiB 575.53 KiB
f2cbdf1 1.72 MiB 2.29 MiB 576.04 KiB
c5d4e44 1.72 MiB 2.29 MiB 576.09 KiB

@codecov

codecov Bot commented Jul 25, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 87.17% and project coverage change: +0.19% 🎉

Comparison is base (9020d1b) 81.26% compared to head (61f011b) 81.45%.
Report is 42 commits behind head on feat/7.0.0.

Additional details and impacted files
@@               Coverage Diff                @@
##             feat/7.0.0    #2865      +/-   ##
================================================
+ Coverage         81.26%   81.45%   +0.19%     
- Complexity         4560     4660     +100     
================================================
  Files               350      354       +4     
  Lines             16866    17153     +287     
  Branches           2272     2320      +48     
================================================
+ Hits              13706    13972     +266     
- Misses             2219     2231      +12     
- Partials            941      950       +9     
Files Changed Coverage Δ
...racing/SentrySpanClientHttpRequestInterceptor.java 0.00% <0.00%> (ø)
...ebflux/SentryWebFilterWithThreadLocalAccessor.java 0.00% <0.00%> (ø)
...racing/SentrySpanClientHttpRequestInterceptor.java 0.00% <0.00%> (ø)
sentry/src/main/java/io/sentry/Breadcrumb.java 85.04% <ø> (ø)
sentry/src/main/java/io/sentry/HostnameCache.java 90.69% <ø> (ø)
sentry/src/main/java/io/sentry/Hub.java 75.17% <ø> (ø)
.../src/main/java/io/sentry/JsonObjectSerializer.java 84.21% <ø> (ø)
...ry/src/main/java/io/sentry/ProfilingTraceData.java 78.51% <ø> (ø)
.../main/java/io/sentry/ProfilingTransactionData.java 52.52% <ø> (ø)
sentry/src/main/java/io/sentry/Scope.java 96.72% <0.00%> (-0.36%) ⬇️
... and 83 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stefanosiano

Copy link
Copy Markdown
Contributor

Are we going to add timeout for all of auto transactions?
I'm referring to SentrySpanProcessor or SentryNavigationListener

@markushi

Copy link
Copy Markdown
Member Author

Are we going to add timeout for all of auto transactions? I'm referring to SentrySpanProcessor or SentryNavigationListener

Ah I missed SentryNavigationListener, thanks!

For SentrySpanProcessor and other more backend related transaction like SentryTracingFilter or SentryWebFilter I don't think it makes a lot of sense, @adinauer any opinions on this?

@adinauer

adinauer commented Aug 4, 2023

Copy link
Copy Markdown
Member

The backend request transactions should in theory always be finished once the request finishes or is cancelled. Having a deadline makes sense for the annotation based @Transaction and manual transactions tho.

For the OTEL SentrySpanProcessor I think it's best to leave this to OTEL and not forcefully finish any transactions there.

Since I'm in the middle of moving our Spring Boot code into a new module in #2880 maybe it makes more sense to split out the backend part here and do it in a follow up PR.

@markushi
markushi requested a review from stefanosiano August 4, 2023 08:21

@stefanosiano stefanosiano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice!

Comment thread sentry/src/main/java/io/sentry/SentryTracer.java Outdated
@markushi
markushi requested a review from romtsn August 8, 2023 06:43
@markushi
markushi merged commit 0b3de21 into feat/7.0.0 Aug 8, 2023
@markushi
markushi deleted the feat/deadline-for-automatic-ui-transactions branch August 8, 2023 07:30
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.

4 participants