-
-
Notifications
You must be signed in to change notification settings - Fork 342
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 Sentry Middleware for source context in debug builds #4287
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…eFrames`" This reverts commit c8ae2b9.
|
iOS (legacy) Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
fe13591+dirty | 1208.25 ms | 1219.53 ms | 11.28 ms |
d2c32bb+dirty | 1223.69 ms | 1229.49 ms | 5.80 ms |
c2a4e9b+dirty | 1240.10 ms | 1239.22 ms | -0.88 ms |
ad6c299+dirty | 1244.76 ms | 1260.10 ms | 15.34 ms |
eb1e19f+dirty | 1209.56 ms | 1214.94 ms | 5.38 ms |
b1e8712+dirty | 1256.02 ms | 1265.14 ms | 9.12 ms |
1faf8e3+dirty | 1214.87 ms | 1222.83 ms | 7.97 ms |
6e8584e+dirty | 1274.50 ms | 1296.82 ms | 22.32 ms |
52a8031+dirty | 1280.88 ms | 1289.78 ms | 8.90 ms |
4cc5c27+dirty | 1211.45 ms | 1214.60 ms | 3.16 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
fe13591+dirty | 2.36 MiB | 3.10 MiB | 752.40 KiB |
d2c32bb+dirty | 2.36 MiB | 3.08 MiB | 737.22 KiB |
c2a4e9b+dirty | 2.36 MiB | 3.08 MiB | 734.00 KiB |
ad6c299+dirty | 2.36 MiB | 2.84 MiB | 488.85 KiB |
eb1e19f+dirty | 2.36 MiB | 3.08 MiB | 737.21 KiB |
b1e8712+dirty | 2.36 MiB | 2.84 MiB | 488.84 KiB |
1faf8e3+dirty | 2.36 MiB | 3.08 MiB | 736.75 KiB |
6e8584e+dirty | 2.36 MiB | 2.88 MiB | 533.17 KiB |
52a8031+dirty | 2.36 MiB | 2.82 MiB | 469.44 KiB |
4cc5c27+dirty | 2.36 MiB | 3.04 MiB | 698.52 KiB |
iOS (new) Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
fe13591+dirty | 1250.69 ms | 1246.27 ms | -4.43 ms |
d2c32bb+dirty | 1244.00 ms | 1245.77 ms | 1.77 ms |
c2a4e9b+dirty | 1247.39 ms | 1243.04 ms | -4.35 ms |
ad6c299+dirty | 1248.50 ms | 1248.88 ms | 0.38 ms |
eb1e19f+dirty | 1229.91 ms | 1231.63 ms | 1.71 ms |
b1e8712+dirty | 1284.11 ms | 1297.82 ms | 13.71 ms |
1faf8e3+dirty | 1223.38 ms | 1220.56 ms | -2.82 ms |
6e8584e+dirty | 1271.71 ms | 1281.26 ms | 9.55 ms |
52a8031+dirty | 1255.96 ms | 1273.00 ms | 17.04 ms |
4cc5c27+dirty | 1220.43 ms | 1215.13 ms | -5.30 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
fe13591+dirty | 2.92 MiB | 3.66 MiB | 757.71 KiB |
d2c32bb+dirty | 2.92 MiB | 3.64 MiB | 742.84 KiB |
c2a4e9b+dirty | 2.92 MiB | 3.64 MiB | 739.91 KiB |
ad6c299+dirty | 2.92 MiB | 3.40 MiB | 494.12 KiB |
eb1e19f+dirty | 2.92 MiB | 3.64 MiB | 742.82 KiB |
b1e8712+dirty | 2.92 MiB | 3.40 MiB | 494.15 KiB |
1faf8e3+dirty | 2.92 MiB | 3.64 MiB | 742.61 KiB |
6e8584e+dirty | 2.92 MiB | 3.44 MiB | 536.52 KiB |
52a8031+dirty | 2.92 MiB | 3.38 MiB | 475.71 KiB |
4cc5c27+dirty | 2.92 MiB | 3.61 MiB | 705.47 KiB |
Android (new) Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
457e29f+dirty | 591.49 ms | 612.96 ms | 21.47 ms |
63ed251+dirty | 485.02 ms | 531.16 ms | 46.14 ms |
ac41368+dirty | 395.91 ms | 451.17 ms | 55.26 ms |
1d86dd6+dirty | 335.76 ms | 371.22 ms | 35.46 ms |
575f9da+dirty | 337.15 ms | 370.47 ms | 33.32 ms |
e540498+dirty | 408.56 ms | 480.00 ms | 71.44 ms |
4a6664f+dirty | 357.02 ms | 394.91 ms | 37.89 ms |
9cd0e9f+dirty | 383.65 ms | 418.65 ms | 35.00 ms |
e1ea4a8+dirty | 451.98 ms | 497.58 ms | 45.60 ms |
b1e8712+dirty | 322.55 ms | 331.84 ms | 9.29 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
457e29f+dirty | 7.15 MiB | 8.10 MiB | 981.29 KiB |
63ed251+dirty | 7.15 MiB | 8.35 MiB | 1.20 MiB |
ac41368+dirty | 7.15 MiB | 8.39 MiB | 1.24 MiB |
1d86dd6+dirty | 7.15 MiB | 8.13 MiB | 1002.18 KiB |
575f9da+dirty | 7.15 MiB | 8.10 MiB | 979.68 KiB |
e540498+dirty | 7.15 MiB | 8.38 MiB | 1.23 MiB |
4a6664f+dirty | 7.15 MiB | 8.22 MiB | 1.07 MiB |
9cd0e9f+dirty | 7.15 MiB | 8.35 MiB | 1.20 MiB |
e1ea4a8+dirty | 7.15 MiB | 8.35 MiB | 1.20 MiB |
b1e8712+dirty | 7.15 MiB | 8.04 MiB | 912.27 KiB |
Android (legacy) Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
e2b64fe | 316.88 ms | 330.23 ms | 13.35 ms |
5446992 | 403.40 ms | 426.70 ms | 23.30 ms |
eb1e19f | 433.55 ms | 444.90 ms | 11.35 ms |
cdf2f33 | 469.46 ms | 462.17 ms | -7.29 ms |
70e6261 | 482.65 ms | 495.70 ms | 13.05 ms |
457e29f | 398.10 ms | 421.39 ms | 23.29 ms |
80b2ce3 | 385.02 ms | 387.36 ms | 2.34 ms |
8ae23a7 | 526.83 ms | 513.38 ms | -13.45 ms |
2ec71da | 438.14 ms | 460.46 ms | 22.32 ms |
d361d38 | 354.10 ms | 381.69 ms | 27.59 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
e2b64fe | 17.73 MiB | 19.80 MiB | 2.07 MiB |
5446992 | 17.73 MiB | 19.85 MiB | 2.12 MiB |
eb1e19f | 17.74 MiB | 20.08 MiB | 2.34 MiB |
cdf2f33 | 17.74 MiB | 20.08 MiB | 2.34 MiB |
70e6261 | 17.73 MiB | 19.94 MiB | 2.21 MiB |
457e29f | 17.73 MiB | 19.84 MiB | 2.10 MiB |
80b2ce3 | 17.73 MiB | 19.75 MiB | 2.02 MiB |
8ae23a7 | 17.74 MiB | 20.07 MiB | 2.34 MiB |
2ec71da | 17.73 MiB | 20.10 MiB | 2.37 MiB |
d361d38 | 17.73 MiB | 19.81 MiB | 2.08 MiB |
antonis
approved these changes
Nov 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code LGTM and the RN and Expo samples work as expected with the enableSourceContextInDevelopment
flag enabled and disabled 🚀
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
This PR sdds Sentry Metro Server Middleware which is enables the SDK to fetch source context in development build using one request.
This improves the resolution logic which originally required multiple requests per frame to get source context.
Another improvement is that request to a middleware does not trigger web builds in Expo applications. This makes the event processing faster and less confusing to the end user, who might be confused by why the web build are triggered (side note the if the web build would fail it might look like there is an error in the app).
💡 Motivation and Context
In Expo SDK52 the dev server stopped serving the project file, thus the Sentry SDK could not retried the source context at all. Error in debug build would be locally symbolicated but without source context.
RN 0.76 still serves the files as expected.
💚 How did you test it?
sample expo app, sample rn app
📝 Checklist
sendDefaultPII
is enabled🔮 Next steps