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

feat(metro): Add withSentryConfig metro configuration helper #3478

Merged
merged 5 commits into from Jan 19, 2024

Conversation

krystofwoldrich
Copy link
Member

@krystofwoldrich krystofwoldrich commented Dec 16, 2023

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Adds a new metro configuration helper withSentry.

This helper adds Sentry Metro Serializer and Also patches the dev server frames symbolicator to collapse Sentry frames in LogBox.

💡 Motivation and Context

Before

Screenshot 2024-01-18 at 14 27 01

After

Screenshot 2024-01-18 at 14 27 25

💚 How did you test it?

sample app

📝 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
  • All tests passing
  • No breaking changes

Copy link
Contributor

github-actions bot commented Dec 16, 2023

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

Generated by 🚫 dangerJS against f24cf30

Copy link
Contributor

github-actions bot commented Dec 16, 2023

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 385.75 ms 411.20 ms 25.45 ms
Size 17.73 MiB 19.85 MiB 2.11 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
2534337 394.15 ms 415.12 ms 20.97 ms
e2b64fe 316.88 ms 330.23 ms 13.35 ms
12427f4 393.69 ms 414.84 ms 21.14 ms
d361d38 354.10 ms 381.69 ms 27.59 ms
acadc0f+dirty 373.24 ms 381.51 ms 8.27 ms
e73f4ed+dirty 332.96 ms 354.33 ms 21.37 ms
abb7058 370.27 ms 389.58 ms 19.31 ms
34aba08 328.10 ms 342.84 ms 14.74 ms
457e29f 398.10 ms 421.39 ms 23.29 ms
22e31b6 396.48 ms 419.64 ms 23.16 ms

App size

Revision Plain With Sentry Diff
2534337 17.73 MiB 19.84 MiB 2.11 MiB
e2b64fe 17.73 MiB 19.80 MiB 2.07 MiB
12427f4 17.73 MiB 19.85 MiB 2.12 MiB
d361d38 17.73 MiB 19.81 MiB 2.08 MiB
acadc0f+dirty 17.73 MiB 19.75 MiB 2.01 MiB
e73f4ed+dirty 17.73 MiB 20.04 MiB 2.31 MiB
abb7058 17.73 MiB 19.83 MiB 2.10 MiB
34aba08 17.73 MiB 19.80 MiB 2.07 MiB
457e29f 17.73 MiB 19.84 MiB 2.10 MiB
22e31b6 17.73 MiB 19.84 MiB 2.10 MiB

Previous results on branch: kw-add-with-sentry-metro-config

Startup times

Revision Plain With Sentry Diff
606737c 439.13 ms 470.00 ms 30.87 ms

App size

Revision Plain With Sentry Diff
606737c 17.73 MiB 19.84 MiB 2.11 MiB

Copy link
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1211.52 ms 1211.57 ms 0.05 ms
Size 2.36 MiB 2.88 MiB 524.03 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d0bf494+dirty 1289.40 ms 1298.40 ms 9.00 ms
3853f43+dirty 1221.82 ms 1242.64 ms 20.82 ms
e73f4ed+dirty 1243.27 ms 1244.52 ms 1.25 ms
9c48b2c+dirty 1246.96 ms 1255.73 ms 8.77 ms
27ef4ee+dirty 1293.52 ms 1296.08 ms 2.56 ms
6e8584e+dirty 1274.50 ms 1296.82 ms 22.32 ms
acadc0f+dirty 1264.38 ms 1290.06 ms 25.68 ms
8900e1a+dirty 1210.27 ms 1218.66 ms 8.39 ms
e2b64fe+dirty 1232.22 ms 1255.20 ms 22.98 ms
e5c9b8b+dirty 1258.57 ms 1267.32 ms 8.75 ms

App size

Revision Plain With Sentry Diff
d0bf494+dirty 2.36 MiB 2.83 MiB 481.15 KiB
3853f43+dirty 2.36 MiB 2.85 MiB 499.81 KiB
e73f4ed+dirty 2.36 MiB 2.82 MiB 469.44 KiB
9c48b2c+dirty 2.36 MiB 2.85 MiB 495.77 KiB
27ef4ee+dirty 2.36 MiB 2.85 MiB 500.03 KiB
6e8584e+dirty 2.36 MiB 2.88 MiB 533.17 KiB
acadc0f+dirty 2.36 MiB 2.83 MiB 480.37 KiB
8900e1a+dirty 2.36 MiB 2.83 MiB 479.25 KiB
e2b64fe+dirty 2.36 MiB 2.85 MiB 495.80 KiB
e5c9b8b+dirty 2.36 MiB 2.87 MiB 520.43 KiB

Copy link
Contributor

github-actions bot commented Dec 16, 2023

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1203.92 ms 1206.27 ms 2.35 ms
Size 2.92 MiB 3.44 MiB 530.85 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
9433f35+dirty 1232.24 ms 1232.74 ms 0.50 ms
9c48b2c+dirty 1253.39 ms 1256.30 ms 2.91 ms
1d86dd6+dirty 1289.25 ms 1293.36 ms 4.11 ms
d361d38+dirty 1272.96 ms 1291.70 ms 18.74 ms
12427f4+dirty 1224.90 ms 1231.40 ms 6.50 ms
6e8584e+dirty 1271.71 ms 1281.26 ms 9.55 ms
3ffcddd+dirty 1272.22 ms 1273.98 ms 1.76 ms
22e31b6+dirty 1276.55 ms 1278.12 ms 1.57 ms
0677344+dirty 1252.52 ms 1254.08 ms 1.56 ms
3853f43+dirty 1271.74 ms 1278.04 ms 6.30 ms

App size

Revision Plain With Sentry Diff
9433f35+dirty 2.92 MiB 3.41 MiB 503.55 KiB
9c48b2c+dirty 2.92 MiB 3.41 MiB 499.97 KiB
1d86dd6+dirty 2.92 MiB 3.44 MiB 538.27 KiB
d361d38+dirty 2.92 MiB 3.41 MiB 503.57 KiB
12427f4+dirty 2.92 MiB 3.44 MiB 533.29 KiB
6e8584e+dirty 2.92 MiB 3.44 MiB 536.52 KiB
3ffcddd+dirty 2.92 MiB 3.40 MiB 494.39 KiB
22e31b6+dirty 2.92 MiB 3.43 MiB 524.74 KiB
0677344+dirty 2.92 MiB 3.41 MiB 500.94 KiB
3853f43+dirty 2.92 MiB 3.41 MiB 503.54 KiB

Previous results on branch: kw-add-with-sentry-metro-config

Startup times

Revision Plain With Sentry Diff
606737c+dirty 1208.09 ms 1208.76 ms 0.67 ms

App size

Revision Plain With Sentry Diff
606737c+dirty 2.92 MiB 3.43 MiB 528.41 KiB

Copy link
Contributor

github-actions bot commented Dec 16, 2023

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 390.20 ms 408.28 ms 18.08 ms
Size 7.15 MiB 8.11 MiB 989.98 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
12427f4+dirty 379.48 ms 400.92 ms 21.44 ms
5446992+dirty 371.61 ms 390.00 ms 18.39 ms
1d86dd6+dirty 335.76 ms 371.22 ms 35.46 ms
b1e8712+dirty 322.55 ms 331.84 ms 9.29 ms
9433f35+dirty 265.50 ms 336.08 ms 70.58 ms
3ffcddd+dirty 244.82 ms 295.47 ms 50.65 ms
acadc0f+dirty 259.04 ms 304.67 ms 45.63 ms
575f9da+dirty 337.15 ms 370.47 ms 33.32 ms
e73f4ed+dirty 262.98 ms 311.02 ms 48.04 ms
34aba08+dirty 331.79 ms 376.69 ms 44.91 ms

App size

Revision Plain With Sentry Diff
12427f4+dirty 7.15 MiB 8.12 MiB 997.78 KiB
5446992+dirty 7.15 MiB 8.12 MiB 999.45 KiB
1d86dd6+dirty 7.15 MiB 8.13 MiB 1002.18 KiB
b1e8712+dirty 7.15 MiB 8.04 MiB 912.27 KiB
9433f35+dirty 7.15 MiB 8.08 MiB 959.34 KiB
3ffcddd+dirty 7.15 MiB 8.04 MiB 912.17 KiB
acadc0f+dirty 7.15 MiB 8.03 MiB 903.20 KiB
575f9da+dirty 7.15 MiB 8.10 MiB 979.68 KiB
e73f4ed+dirty 7.15 MiB 8.09 MiB 965.94 KiB
34aba08+dirty 7.15 MiB 8.07 MiB 946.13 KiB

Previous results on branch: kw-add-with-sentry-metro-config

Startup times

Revision Plain With Sentry Diff
606737c+dirty 352.04 ms 403.48 ms 51.44 ms

App size

Revision Plain With Sentry Diff
606737c+dirty 7.15 MiB 8.11 MiB 988.22 KiB

@krystofwoldrich krystofwoldrich marked this pull request as ready for review January 18, 2024 13:52
@krystofwoldrich krystofwoldrich changed the title feat(metro): Add withSentry metro configuration helper feat(metro): Add withSentryConfig metro configuration helper Jan 18, 2024
@lucas-zimerman
Copy link
Collaborator

We should also make a new issue to remember to create the documentation of withSentryConfig on sentry-docs.

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.

The other comments are non blocking for the merge so LGTM!

src/js/tools/metroconfig.ts Show resolved Hide resolved
src/js/tools/metroconfig.ts Show resolved Hide resolved
@krystofwoldrich krystofwoldrich merged commit 1cc72a3 into main Jan 19, 2024
47 of 52 checks passed
@krystofwoldrich krystofwoldrich deleted the kw-add-with-sentry-metro-config branch January 19, 2024 14:35
@fabiendem
Copy link

Hey @krystofwoldrich, looking at the release notes at https://github.com/getsentry/sentry-react-native/releases/tag/5.17.0 it's not clear to use if any action is required in our metro config to enable this feature.
I can't find anything in the react-native sentry doc. Could you clarify please?
Cheers!

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.

LogBox shows instrument.js for all codeframes
3 participants