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

ref(replay): Improve logging for stopped replay #7174

Merged
merged 1 commit into from
Feb 15, 2023
Merged

Conversation

mydea
Copy link
Member

@mydea mydea commented Feb 14, 2023

This PR should help with debugging stopped replays.

  • Add an (optional) reason for stopping replays, to know what triggered the stop
  • Ensure that we log to the console when _experiments.traceInternals === true, so we get these logs for sentry.io.

Closes #7149
Note that it doesn't actually fix this issue, but will give us more info in the future to debug these things. As of now, it is pretty hard to reason about why this happend.

@mydea mydea added the Package: replay Issues related to the Sentry Replay SDK label Feb 14, 2023
@mydea mydea requested a review from billyvg February 14, 2023 12:26
@mydea mydea self-assigned this Feb 14, 2023
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.09 KB (+0.05% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 62.23 KB (+0.03% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.71 KB (+0.06% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 55.37 KB (+0.04% 🔺)
@sentry/browser - Webpack (gzipped + minified) 20.44 KB (+0.03% 🔺)
@sentry/browser - Webpack (minified) 66.81 KB (+0.03% 🔺)
@sentry/react - Webpack (gzipped + minified) 20.47 KB (+0.03% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.9 KB (+0.02% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 27.03 KB (+0.04% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.29 KB (+0.05% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 42.52 KB (+0.08% 🔺)
@sentry/replay - Webpack (gzipped + minified) 36.72 KB (-0.46% 🔽)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 60.24 KB (+0.06% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 53.78 KB (+0.07% 🔺)

@github-actions
Copy link
Contributor

Replay SDK metrics 🚀

    Plain +Sentry +Replay
Revision Value Value Diff Ratio Value Diff Ratio
LCP This PR 1921888 68.57 ms 89.41 ms +20.84 ms +30.39 % 124.36 ms +55.79 ms +81.35 %
Previous e9eec27 67.47 ms 102.63 ms +35.17 ms +52.13 % 128.85 ms +61.38 ms +90.98 %
CLS This PR 1921888 0.06 ms 0.06 ms -0.00 ms -0.02 % 0.06 ms +0.00 ms +0.03 %
Previous e9eec27 0.06 ms 0.06 ms +0.00 ms +0.07 % 0.06 ms -0.00 ms -0.33 %
CPU This PR 1921888 12.75 % 13.18 % +0.43 pp +3.34 % 18.25 % +5.50 pp +43.12 %
Previous e9eec27 19.40 % 19.02 % -0.37 pp -1.92 % 25.44 % +6.04 pp +31.16 %
JS heap avg This PR 1921888 1.94 MB 1.99 MB +46.31 kB +2.38 % 2.87 MB +926.71 kB +47.68 %
Previous e9eec27 1.94 MB 1.99 MB +45.82 kB +2.36 % 2.87 MB +927.84 kB +47.75 %
JS heap max This PR 1921888 2.3 MB 2.56 MB +255.3 kB +11.08 % 3.36 MB +1.06 MB +45.93 %
Previous e9eec27 2.3 MB 2.55 MB +249.12 kB +10.82 % 3.35 MB +1.05 MB +45.46 %
netTx This PR 1921888 0 B 0 B 0 B n/a 2.23 kB +2.23 kB n/a
Previous e9eec27 0 B 0 B 0 B n/a 2.21 kB +2.21 kB n/a
netRx This PR 1921888 0 B 0 B 0 B n/a 41 B +41 B n/a
Previous e9eec27 0 B 0 B 0 B n/a 41 B +41 B n/a
netCount This PR 1921888 0 0 0 n/a 1 +1 n/a
Previous e9eec27 0 0 0 n/a 1 +1 n/a
netTime This PR 1921888 0.00 ms 0.00 ms 0.00 ms n/a 79.78 ms +79.78 ms n/a
Previous e9eec27 0.00 ms 0.00 ms 0.00 ms n/a 88.58 ms +88.58 ms n/a

Previous results on branch: develop

RevisionLCPCLSCPUJS heap avgJS heap maxnetTxnetRxnetCountnetTime
e9eec27+61.38 ms-0.00 ms+6.04 pp+927.84 kB+1.05 MB+2.21 kB+41 B+1+88.58 ms
d604022+58.83 ms-0.00 ms+7.65 pp+930.16 kB+1.05 MB+2.21 kB+41 B+1+109.63 ms
a961e57+54.75 ms-0.00 ms+6.50 pp+929.18 kB+1.07 MB+2.21 kB+41 B+1+92.73 ms
f7c0a2f+46.14 ms+0.00 ms+6.37 pp+921.47 kB+1.06 MB+2.23 kB+41 B+1+207.30 ms
cb19818+57.16 ms+0.00 ms+11.95 pp+1.07 MB+2.21 MB+2.52 kB+41 B+1+111.50 ms
ee301c3+71.07 ms-0.00 ms+12.64 pp+1.07 MB+2.22 MB+2.55 kB+41 B+1+94.67 ms
93c4759+61.10 ms-0.00 ms+12.72 pp+1.08 MB+2.19 MB+2.57 kB+41 B+1+116.75 ms
274f489+63.60 ms-0.00 ms+11.56 pp+1.08 MB+2.2 MB+2.56 kB+41 B+1+116.60 ms
4827b60+58.67 ms+0.00 ms+18.38 pp+1.07 MB+2.22 MB+2.6 kB+41 B+1+91.21 ms
c3806eb+79.85 ms-0.00 ms+12.10 pp+1.05 MB+2.16 MB+2.54 kB+41 B+1+93.58 ms

*) pp - percentage points - an absolute difference between two percentages.
Last updated: Tue, 14 Feb 2023 13:43:11 GMT

@@ -426,7 +435,7 @@ export class ReplayContainer implements ReplayContainerInterface {
this.session = session;

if (!this.session.sampled) {
this.stop();
this.stop('session unsampled');
Copy link
Member

Choose a reason for hiding this comment

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

This should never show up right?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, this can happen when an error session ends - it will then be set to unsampled for the "follow up" session. Something to look into a bit more, maybe...!

@mydea mydea merged commit 1c9ed4f into develop Feb 15, 2023
@mydea mydea deleted the fn/log-replay-stop branch February 15, 2023 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: replay Issues related to the Sentry Replay SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replay stops unexpectedly (error is captured after it stops)
2 participants