Skip to content

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

Merged
mydea merged 1 commit into
developfrom
fn/log-replay-stop
Feb 15, 2023
Merged

ref(replay): Improve logging for stopped replay#7174
mydea merged 1 commit into
developfrom
fn/log-replay-stop

Conversation

@mydea

Copy link
Copy Markdown
Member

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 requested a review from billyvgFebruary 14, 2023 12:26
@mydeamydea self-assigned this Feb 14, 2023
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@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
Copy Markdown
Contributor

Replay SDK metrics 🚀

Plain+Sentry+Replay
RevisionValueValueDiffRatioValueDiffRatio
LCPThis PR 192188868.57 ms89.41 ms+20.84 ms+30.39 %124.36 ms+55.79 ms+81.35 %
Previous e9eec2767.47 ms102.63 ms+35.17 ms+52.13 %128.85 ms+61.38 ms+90.98 %
CLSThis PR 19218880.06 ms0.06 ms-0.00 ms-0.02 %0.06 ms+0.00 ms+0.03 %
Previous e9eec270.06 ms0.06 ms+0.00 ms+0.07 %0.06 ms-0.00 ms-0.33 %
CPUThis PR 192188812.75 %13.18 %+0.43 pp+3.34 %18.25 %+5.50 pp+43.12 %
Previous e9eec2719.40 %19.02 %-0.37 pp-1.92 %25.44 %+6.04 pp+31.16 %
JS heap avgThis PR 19218881.94 MB1.99 MB+46.31 kB+2.38 %2.87 MB+926.71 kB+47.68 %
Previous e9eec271.94 MB1.99 MB+45.82 kB+2.36 %2.87 MB+927.84 kB+47.75 %
JS heap maxThis PR 19218882.3 MB2.56 MB+255.3 kB+11.08 %3.36 MB+1.06 MB+45.93 %
Previous e9eec272.3 MB2.55 MB+249.12 kB+10.82 %3.35 MB+1.05 MB+45.46 %
netTxThis PR 19218880 B0 B0 Bn/a2.23 kB+2.23 kBn/a
Previous e9eec270 B0 B0 Bn/a2.21 kB+2.21 kBn/a
netRxThis PR 19218880 B0 B0 Bn/a41 B+41 Bn/a
Previous e9eec270 B0 B0 Bn/a41 B+41 Bn/a
netCountThis PR 1921888000n/a1+1n/a
Previous e9eec27000n/a1+1n/a
netTimeThis PR 19218880.00 ms0.00 ms0.00 msn/a79.78 ms+79.78 msn/a
Previous e9eec270.00 ms0.00 ms0.00 msn/a88.58 ms+88.58 msn/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


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

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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 developFeb 15, 2023
@mydea
mydea deleted the fn/log-replay-stop branch February 15, 2023 08:07
Sign up for freeto 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.

Replay stops unexpectedly (error is captured after it stops)

2 participants

@mydea@billyvg