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(nextjs): Improve client stack traces #7097

Merged
merged 6 commits into from Feb 9, 2023

Conversation

lforst
Copy link
Member

@lforst lforst commented Feb 8, 2023

Reading this blog post we should probably do what they're doing out of the box: https://hackernoon.com/how-to-upload-source-maps-to-sentry-with-nextjs

Also marks Next.js internal frames with in_app: false because users shouldn't care about those.

@lforst lforst requested review from mydea and Lms24 February 8, 2023 15:30
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

would be great to get a test!

@lforst
Copy link
Member Author

lforst commented Feb 8, 2023

would be great to get a test!

Trust me it works

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.06 KB (0%)
@sentry/browser - ES5 CDN Bundle (minified) 62.19 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.69 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified) 55.33 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.42 KB (0%)
@sentry/browser - Webpack (minified) 66.77 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.45 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.85 KB (+0.23% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.97 KB (0%)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.23 KB (0%)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 42.28 KB (0%)
@sentry/replay - Webpack (gzipped + minified) 36.7 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 59.93 KB (0%)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 53.48 KB (0%)

@AbhiPrasad
Copy link
Member

@AntonBurduzha fyi

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

Replay SDK metrics 🚀

    Plain +Sentry +Replay
Revision Value Value Diff Ratio Value Diff Ratio
LCP This PR fcf17a8 67.27 ms 89.69 ms +22.42 ms +33.34 % 124.67 ms +57.40 ms +85.33 %
Previous 5c937aa 74.77 ms 101.57 ms +26.79 ms +35.83 % 130.27 ms +55.49 ms +74.21 %
CLS This PR fcf17a8 0.06 ms 0.06 ms -0.00 ms -0.03 % 0.06 ms +0.00 ms +0.02 %
Previous 5c937aa 0.06 ms 0.06 ms -0.00 ms -0.31 % 0.06 ms +0.00 ms +0.54 %
CPU This PR fcf17a8 12.39 % 12.20 % -0.19 pp -1.51 % 24.37 % +11.98 pp +96.68 %
Previous 5c937aa 13.96 % 13.27 % -0.70 pp -4.99 % 28.44 % +14.47 pp +103.62 %
JS heap avg This PR fcf17a8 1.94 MB 1.99 MB +49.12 kB +2.53 % 3.06 MB +1.11 MB +57.24 %
Previous 5c937aa 1.93 MB 2 MB +65.98 kB +3.41 % 3.02 MB +1.08 MB +56.07 %
JS heap max This PR fcf17a8 2.3 MB 2.56 MB +256.62 kB +11.14 % 4.64 MB +2.33 MB +101.27 %
Previous 5c937aa 2.3 MB 2.58 MB +272.13 kB +11.81 % 4.53 MB +2.22 MB +96.54 %
netTx This PR fcf17a8 0 B 0 B 0 B n/a 2.56 kB +2.56 kB n/a
Previous 5c937aa 0 B 0 B 0 B n/a 2.61 kB +2.61 kB n/a
netRx This PR fcf17a8 0 B 0 B 0 B n/a 41 B +41 B n/a
Previous 5c937aa 0 B 0 B 0 B n/a 41 B +41 B n/a
netCount This PR fcf17a8 0 0 0 n/a 1 +1 n/a
Previous 5c937aa 0 0 0 n/a 1 +1 n/a
netTime This PR fcf17a8 0.00 ms 0.00 ms 0.00 ms n/a 73.66 ms +73.66 ms n/a
Previous 5c937aa 0.00 ms 0.00 ms 0.00 ms n/a 68.14 ms +68.14 ms n/a

Previous results on branch: develop

RevisionLCPCLSCPUJS heap avgJS heap maxnetTxnetRxnetCountnetTime
5c937aa+55.49 ms+0.00 ms+14.47 pp+1.08 MB+2.22 MB+2.61 kB+41 B+1+68.14 ms
45638e4+71.80 ms+0.00 ms+21.94 pp+1.1 MB+2.26 MB+2.61 kB+41 B+1+98.15 ms
b539b36+53.97 ms-0.00 ms+16.53 pp+1.12 MB+2.23 MB+2.61 kB+41 B+1+114.29 ms
6462b00+62.18 ms+0.00 ms+23.70 pp+1.1 MB+2.23 MB+2.57 kB+41 B+1+117.17 ms

*) pp - percentage points - an absolute difference between two percentages.
Last updated: Thu, 09 Feb 2023 09:39:01 GMT

@lforst
Copy link
Member Author

lforst commented Feb 9, 2023

@AbhiPrasad I caved and added tests and only potentially discovered an edge case lol

@AbhiPrasad
Copy link
Member

@AbhiPrasad I caved and added tests and only potentially discovered an edge case lol

79096ca119b85ed399e93d34383d8aea

if (
frame.filename &&
frame.filename.match(
/^app:\/\/\/_next\/static\/chunks\/(main-|main-app-|polyfills-|webpack-|framework-|framework\.)[0-9a-f]+\.js$/,
Copy link
Member

Choose a reason for hiding this comment

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

will this have any possible issues with windows paths?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's just on the client so we're good

@lforst lforst merged commit 538c3a6 into develop Feb 9, 2023
@lforst lforst deleted the lforst-better-nextjs-client-stacktraces branch February 9, 2023 15:04
@smeubank smeubank mentioned this pull request Feb 21, 2023
3 tasks
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.

None yet

2 participants