-
-
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
Flush saves the recorded session even if the sample rate is zero #12664
Comments
Hey, this is expected behavior for What's your use case here? We could expose the recording mode, if that's important. |
@mydea let me give you some context on our use case. we run an application in an iframe that is embeded in mulitple customer websites. this iframe holds a checkout process and once the checkout is done, we close the iframe so the user can keep the navigation in the store. if we don't call the the main issue arose when we decided to only record sessions for merchants based on a dynamic runtime discovered sample rate, cause we don't need to record every session, but what happens if that if this session was not suposed to be sampled and we call flush, it still keeps a recording of it. do we have a way to determine if a session was sampled or not so we can call flush conditionaly? if not, there is a way to prevent this "extra session" being recorded even when calling flush? |
oh, forgot to mention, me and @vctormb work at the same place :) |
OK, I see. This makes sense I think, IMHO we can expose For now, you should be able to make this work like this - this is internals, but you can try it: // Only flush if recordingMode is session
// This would be `buffer` otherwise
if (replay._replay.recordingMode === 'session') {
replay.flush();
} |
indeed, it worked for us (sorry it took so long to reply). thanks @mydea |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
8.10.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
replaysSessionSampleRate = 0
andreplaysOnErrorSampleRate = 1.0
Sentry.getReplay().flush()
and it will upload a new video recording even if replaysSessionSampleRate is 0Expected Result
It should not record a video when calling
flush
ifreplaysSessionSampleRate = 0
Actual Result
It is recording a video when calling
flush
whenreplaysSessionSampleRate = 0
.The text was updated successfully, but these errors were encountered: