-
-
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
Allow Session Replay "replaysOnErrorSampleRate" variable to accept an array of possible logging levels #9413
Comments
Hey, thanks for writing in! I think a better way to realise this is to allow to put a property on the event telling replay to ignore this. E.g. something like this: Sentry.init({
beforeSend(event) {
// if this should not go to replay:
event.IGNORE_REPLAY = true;
}
}); cc @billyvg WDYT? |
@mydea sure, so if we were capturing an exception, it would look like this?
|
If we go with my idea above, you'd have to add an event processor or a |
Ok, let me make sure I understand correctly. First I would capture an exception like this:
then in the beforeSend callback I would add this
Is that correct? |
Yeah, something like this (although the exact API & naming is still open) - but API-wise, that could work I believe! |
@mydea thank you, that's great to hear. This would be really helpful for us, is this something the Sentry team could implement in the near future? |
Do we take |
This adds a new option to `new Replay()` which allows to ignore certain errors for error-based sampling: ```js new Replay({ beforeErrorSampling: (event) => !event.message.includes('ignore me') }); ``` When returning `false` from this callback, the event will not trigger an error-based sampling. Note that returning `true` there does not mean this will 100% be sampled, but just that it will check the `replaysOnErrorSampleRate`. The purpose of this callback is to be able to ignore certain groups of errors from triggering an error-based replay at all. Closes #9413 Related to #8462 (not 100% but partially)
Hey! In 7.78.0, you can now configure a callback to replay to solve this: new Replay({
beforeErrorSampling(event) {
// return true to sample for this error, or false to not sample
}
}) |
Thank you so much for the quick turnaround! Much appreciated |
Problem Statement
I want to not capture replays for all errors, only errors with a logging level of "error" or "fatal"
I am using Sentry to log events with level "debug". I don't want these included in Session replay
Solution Brainstorm
Allow the user to provide an array of logging levels to include in Session Replay's "replaysOnErrorSampleRate" variable config.
Default this to all logging levels if no value is provided
Thank you!
The text was updated successfully, but these errors were encountered: