Skip to content

feat: add flag to SentryNavigatorObserver to enable/disable starting new traces on navigation#3096

Merged
buenaflor merged 23 commits intomainfrom
feat/add-navigator-observer-flag
Jul 21, 2025
Merged

feat: add flag to SentryNavigatorObserver to enable/disable starting new traces on navigation#3096
buenaflor merged 23 commits intomainfrom
feat/add-navigator-observer-flag

Conversation

@buenaflor
Copy link
Copy Markdown
Contributor

@buenaflor buenaflor commented Jul 21, 2025

📜 Description

💡 Motivation and Context

Should allow users to control whether they want this tracing behaviour.

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 21, 2025

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

Generated by 🚫 dangerJS against fbb8c46

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.90%. Comparing base (6f47800) to head (fbb8c46).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3096      +/-   ##
==========================================
+ Coverage   87.91%   88.90%   +0.99%     
==========================================
  Files         287       97     -190     
  Lines        9763     3525    -6238     
==========================================
- Hits         8583     3134    -5449     
+ Misses       1180      391     -789     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@buenaflor buenaflor marked this pull request as ready for review July 21, 2025 11:02
SentryNavigatorObserver({
Hub? hub,
bool enableAutoTransactions = true,
bool enableNewTraceOnNavigation = true,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would enableAutoTransactions somehow have an effect on enableNewTraceOnNavigation?

Copy link
Copy Markdown
Contributor Author

@buenaflor buenaflor Jul 21, 2025

Choose a reason for hiding this comment

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

no, the trace does not collide with transactions at all. it's all a bit confusing since trace and transactions can be confused with one another.

the trace here refers to the concept of a trace (e.g traceId) that all transactions and errors are part of.

that being said I plan on deprecating the enableAutoTransactions at some point anyway

Copy link
Copy Markdown
Collaborator

@denrase denrase left a comment

Choose a reason for hiding this comment

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

Looks good, just one question.

@github-actions
Copy link
Copy Markdown
Contributor

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1249.17 ms 1254.41 ms 5.24 ms
Size 7.86 MiB 9.44 MiB 1.58 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
93b7728 1247.23 ms 1264.87 ms 17.64 ms
2d34233 1258.19 ms 1268.92 ms 10.73 ms
ec78888 1251.37 ms 1269.40 ms 18.04 ms
73a3c38 1263.37 ms 1277.90 ms 14.53 ms
b6c8720 1252.65 ms 1266.61 ms 13.96 ms
6f47800 1247.52 ms 1259.37 ms 11.85 ms
73dca78 1246.65 ms 1265.42 ms 18.76 ms
6ba4675 1223.12 ms 1238.17 ms 15.04 ms
aeb02f2 1244.29 ms 1256.55 ms 12.26 ms
640ad0c 1241.04 ms 1253.96 ms 12.92 ms

App size

Revision Plain With Sentry Diff
93b7728 7.86 MiB 9.44 MiB 1.58 MiB
2d34233 7.86 MiB 9.44 MiB 1.58 MiB
ec78888 7.86 MiB 9.44 MiB 1.58 MiB
73a3c38 7.86 MiB 9.44 MiB 1.58 MiB
b6c8720 7.86 MiB 9.44 MiB 1.58 MiB
6f47800 7.86 MiB 9.44 MiB 1.58 MiB
73dca78 7.86 MiB 9.44 MiB 1.58 MiB
6ba4675 7.86 MiB 9.44 MiB 1.58 MiB
aeb02f2 7.86 MiB 9.44 MiB 1.58 MiB
640ad0c 7.86 MiB 9.44 MiB 1.58 MiB

@github-actions
Copy link
Copy Markdown
Contributor

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 437.69 ms 525.74 ms 88.06 ms
Size 6.54 MiB 7.69 MiB 1.15 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
c8596a6 474.00 ms 492.96 ms 18.96 ms
81f83eb 471.40 ms 522.14 ms 50.74 ms
93b7728 475.28 ms 489.13 ms 13.86 ms
aeb02f2 373.84 ms 437.00 ms 63.16 ms
793f4dc 462.68 ms 544.21 ms 81.53 ms
b6c8720 457.41 ms 519.04 ms 61.63 ms
6f47800 451.04 ms 509.64 ms 58.60 ms
575ebaa 478.00 ms 585.76 ms 107.76 ms
640ad0c 466.00 ms 552.67 ms 86.67 ms
827bf09 475.40 ms 547.14 ms 71.74 ms

App size

Revision Plain With Sentry Diff
c8596a6 6.54 MiB 7.53 MiB 1015.27 KiB
81f83eb 6.54 MiB 7.69 MiB 1.15 MiB
93b7728 6.54 MiB 7.69 MiB 1.15 MiB
aeb02f2 6.54 MiB 7.69 MiB 1.15 MiB
793f4dc 6.54 MiB 7.69 MiB 1.15 MiB
b6c8720 6.54 MiB 7.69 MiB 1.15 MiB
6f47800 6.54 MiB 7.69 MiB 1.15 MiB
575ebaa 6.54 MiB 7.69 MiB 1.15 MiB
640ad0c 6.54 MiB 7.69 MiB 1.15 MiB
827bf09 6.54 MiB 7.53 MiB 1015.27 KiB

@buenaflor buenaflor merged commit 23d0dbf into main Jul 21, 2025
71 checks passed
@buenaflor buenaflor deleted the feat/add-navigator-observer-flag branch July 21, 2025 11:32
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.

3 participants