Skip to content

fix(tracing): Avoid duplicate network requests (fetch, xhr) by default #4816

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

Merged
merged 3 commits into from
May 8, 2025

Conversation

krystofwoldrich
Copy link
Member

📢 Type of change

  • Bugfix
  • Enhancement

📜 Description

RN Fetch is a polyfill using XHR under the hood. Having both Fetch and XHR tracing enables causes duplicate spans.

Open: Ideally we trace the outer most call, in this case fetch, but that's much complex fix.

Example before:
Screenshot 2025-05-07 at 12 37 00

After:
Screenshot 2025-05-07 at 12 36 44

💚 How did you test it?

sample app, e2e tests

📝 Checklist

  • 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.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

Copy link
Contributor

github-actions bot commented May 7, 2025

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 428.50 ms 422.78 ms -5.72 ms
Size 17.75 MiB 20.13 MiB 2.38 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
7fd512a 442.18 ms 437.57 ms -4.61 ms
3261206 476.43 ms 465.96 ms -10.48 ms
5bb8d5f 431.21 ms 459.40 ms 28.19 ms
c398f67 449.64 ms 461.38 ms 11.74 ms
1d86dd6 405.14 ms 411.06 ms 5.92 ms
0db0c72 372.12 ms 386.00 ms 13.88 ms
bd0ca38 418.14 ms 425.96 ms 7.82 ms
52a8031+dirty 311.55 ms 321.37 ms 9.82 ms
a18210a 455.15 ms 530.29 ms 75.15 ms
b6f8ea2 472.49 ms 469.60 ms -2.89 ms

App size

Revision Plain With Sentry Diff
7fd512a 17.74 MiB 20.08 MiB 2.35 MiB
3261206 17.75 MiB 20.11 MiB 2.37 MiB
5bb8d5f 17.73 MiB 19.93 MiB 2.20 MiB
c398f67 17.73 MiB 19.94 MiB 2.21 MiB
1d86dd6 17.73 MiB 19.86 MiB 2.12 MiB
0db0c72 17.73 MiB 19.75 MiB 2.02 MiB
bd0ca38 17.75 MiB 20.13 MiB 2.38 MiB
52a8031+dirty 17.73 MiB 20.04 MiB 2.31 MiB
a18210a 17.75 MiB 20.11 MiB 2.36 MiB
b6f8ea2 17.75 MiB 20.11 MiB 2.36 MiB

Copy link
Contributor

github-actions bot commented May 7, 2025

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 431.20 ms 466.32 ms 35.12 ms
Size 7.15 MiB 8.40 MiB 1.25 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d16beca+dirty 389.49 ms 423.86 ms 34.37 ms
e652a2e+dirty 368.83 ms 360.91 ms -7.91 ms
5852d77+dirty 378.83 ms 381.89 ms 3.06 ms
abb7058+dirty 320.78 ms 324.08 ms 3.30 ms
950b04f+dirty 308.66 ms 312.69 ms 4.03 ms
1c65324+dirty 381.10 ms 427.26 ms 46.16 ms
cc8a6ca+dirty 397.63 ms 393.60 ms -4.03 ms
cdc3945+dirty 428.13 ms 443.92 ms 15.78 ms
1d7ae00+dirty 373.63 ms 417.21 ms 43.58 ms
79976dd+dirty 373.25 ms 404.64 ms 31.39 ms

App size

Revision Plain With Sentry Diff
d16beca+dirty 7.15 MiB 8.37 MiB 1.22 MiB
e652a2e+dirty 7.15 MiB 8.38 MiB 1.23 MiB
5852d77+dirty 7.15 MiB 8.38 MiB 1.22 MiB
abb7058+dirty 7.15 MiB 8.10 MiB 980.40 KiB
950b04f+dirty 7.15 MiB 8.40 MiB 1.25 MiB
1c65324+dirty 7.15 MiB 8.22 MiB 1.07 MiB
cc8a6ca+dirty 7.15 MiB 8.39 MiB 1.23 MiB
cdc3945+dirty 7.15 MiB 8.39 MiB 1.23 MiB
1d7ae00+dirty 7.15 MiB 8.39 MiB 1.23 MiB
79976dd+dirty 7.15 MiB 8.38 MiB 1.23 MiB

Copy link
Contributor

github-actions bot commented May 7, 2025

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1224.89 ms 1232.14 ms 7.25 ms
Size 2.63 MiB 3.79 MiB 1.16 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
575f9da+dirty 1266.22 ms 1274.84 ms 8.62 ms
94fc925+dirty 1231.12 ms 1223.85 ms -7.27 ms
7d161c0+dirty 1215.20 ms 1218.64 ms 3.43 ms
17c0c2e+dirty 1231.45 ms 1235.10 ms 3.66 ms
e8e44ed+dirty 1220.44 ms 1216.42 ms -4.02 ms
e1e6bc7+dirty 1208.24 ms 1221.46 ms 13.22 ms
f8fa2ad+dirty 1239.08 ms 1235.49 ms -3.59 ms
af2c0b0+dirty 1201.83 ms 1208.94 ms 7.11 ms
2501f36+dirty 1232.17 ms 1232.50 ms 0.33 ms
1c65324+dirty 1235.17 ms 1235.08 ms -0.09 ms

App size

Revision Plain With Sentry Diff
575f9da+dirty 2.36 MiB 2.87 MiB 520.20 KiB
94fc925+dirty 2.63 MiB 3.69 MiB 1.05 MiB
7d161c0+dirty 2.63 MiB 3.75 MiB 1.12 MiB
17c0c2e+dirty 2.63 MiB 3.78 MiB 1.14 MiB
e8e44ed+dirty 2.63 MiB 3.76 MiB 1.13 MiB
e1e6bc7+dirty 2.63 MiB 3.78 MiB 1.15 MiB
f8fa2ad+dirty 2.63 MiB 3.78 MiB 1.14 MiB
af2c0b0+dirty 2.63 MiB 3.76 MiB 1.13 MiB
2501f36+dirty 2.63 MiB 3.76 MiB 1.13 MiB
1c65324+dirty 2.36 MiB 3.04 MiB 698.64 KiB

@krystofwoldrich krystofwoldrich marked this pull request as ready for review May 7, 2025 11:32
Copy link
Collaborator

@antonis antonis left a comment

Choose a reason for hiding this comment

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

LGTM and worked as expected while testing with the sample app 🚀

Note: The failed End-to-End Tests / metrics (new, ios) is not related with the changes and will be fixed with #4817

Copy link
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

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

LGTM!

@krystofwoldrich krystofwoldrich merged commit 8120f0c into main May 8, 2025
93 of 96 checks passed
@krystofwoldrich krystofwoldrich deleted the kw-fix-dulicate-spans branch May 8, 2025 11:08
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