-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(replay): Change the behavior of error-based sampling #7768
Conversation
`stop()` will now flush the eventBuffer before clearing it, as well as removing the session from Session Storage. Due to the flushing, `stop()` is now async. Ref: #7738
size-limit report 📦
|
1e7f0eb
to
1412dec
Compare
128338f
to
e954fe0
Compare
ca4d679
to
de5607d
Compare
…replay-change-sampling-logic
packages/browser-integration-tests/suites/replay/bufferMode/test.ts
Outdated
Show resolved
Hide resolved
packages/browser-integration-tests/suites/replay/bufferMode/test.ts
Outdated
Show resolved
Hide resolved
@@ -36,8 +36,9 @@ export function getSession({ | |||
|
|||
if (!isExpired) { | |||
return { type: 'saved', session }; | |||
} else if (session.sampled === 'error') { | |||
// Error samples should not be re-created when expired, but instead we stop when the replay is done | |||
} else if (!session.shouldRefresh) { |
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 only thing, just to make this sure and clear, is that this means that when an error session expires without an error happened, it could be re-started as a session-session, right? So we may sample it and start sending data once the session resumes. IMHO that's OK, just wanting to be explicit in behavior!
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.
Great change! Left a few comments but all very low importance, just small nitpicks. Looking great 🚀
97cd546
to
d7554b8
Compare
startBuffering()
API to begin replay buffering. This is useful if you turn offreplaysSessionSampleRate
andreplaysOnErrorSampleRate
and want to manually decide when to start replay buffering. You can then callflush()
to save the replay.Closes #7735 #7744 #7193 #6537