Open Sweater-Baron opened 2 weeks ago
Assigning to @getsentry/support for routing ⏲️
Routing to @getsentry/product-owners-replays for triage ⏲️
Hey @Sweater-Baron 👋
Thanks for reporting this.
Are the 'warnings' you're referring to reflected as Sentry errors in the product? (i.e., in our Issues stream)
If so, you can choose to filter out any errors for our replaysOnErrorSampleRate
with beforeErrorSampling
: https://docs.sentry.io/platforms/javascript/session-replay/configuration/
If you don't want to see these warnings whatsoever in the product, you can filter them out all together with beforeSend
: https://docs.sentry.io/platforms/javascript/configuration/options/
Let me know if that helps!
By any chance do you have attachStacktrace = true
? curious if that plays a role
Are you using the captureConsole
integration? console.warn
by itself should not trigger a replay.
We are using captureConsole
to capture console.warn as issues in Sentry. We don't want to filter out the warnings themselves, just don't want replays to be recorded for them.
In the Sentry UI, the level of the issues for these warnings is correctly listed as "Level: Warning", not error level.
We are not using attachStacktrace
in our Sentry.init, so I assume it must be whatever its default value is.
Here's the full Sentry init, if that's helpful:
Sentry.init({
dsn: 'https://56fd57d3e4904a0081fe82111f5db5ee@o1412184.ingest.sentry.io/6751029',
integrations: [
new Sentry.BrowserTracing({
tracePropagationTargets: [/^https:\/\/(.*\.)?mysite\.com\/api.*/],
}),
new Sentry.Replay({
maskAllText: false,
blockAllMedia: false,
}),
new CaptureConsoleIntegration({
levels: ['warn', 'error', 'debug', 'assert'],
}),
new ExtraErrorDataIntegration(),
new ReportingObserverIntegration({
types: ['crash'],
}),
new SessionTimingIntegration(),
],
environment: environmentName, // a string
release: releaseId, // a string
sampleRate: isLocalDev ? 0 : 1,
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: isLocalDev ? 0 : 1.0,
});
Thanks for your reply, makes sense.
As a work around I suggest using the hook @jas-kas suggested, and drop anything that has level:warning
beforeErrorSampling
: https://docs.sentry.io/platforms/javascript/guides/sveltekit/session-replay/understanding-sessions/#ignore-certain-errors-for-error-sampling
We'll consider changes on the default behavior
Environment
SaaS (https://sentry.io/)
Steps to Reproduce
@sentry/react
withreplaysOnErrorSampleRate
set to a value > 0console.warn("Example console warning")
Expected Result
Replays are not recorded for warnings
Actual Result
Replays are recorded for warnings.
This doesn't, in general, seem useful. Replays are useful on errors, for helping to reproduce the error, but I don't think I've ever needed to reproduce a warning, so this just seems like a waste of replay quota and I suspect it's not intended behavior?
Product Area
Replays
Link
No response
DSN
https://56fd57d3e4904a0081fe82111f5db5ee@o1412184.ingest.sentry.io/6751029
Version
No response