sentry
sentry copied to clipboard
Replay: Allow Inbound Filters to apply to replays
Problem Statement
Replays can capture some sessions that are noisy. Sentry has some inbound filters for errors but those don't apply
Tasks
- [ ] Apply inbound filters from settings to Replays
- [ ] Apply React Hydration filters also https://github.com/getsentry/sentry/issues/53234
- [ ] Update the product docs, quota management for Replays
Do you have any plans on when to start working on this? Or is there any alternative to solve the problem?
For me, it's such a serious thing that I can't use Replay.
I'm looking forward to good news.
@jiwon-mun to help us prioritize things could you help us by explaining what filters exactly you rely on?
As a work around, I wonder if you can detect them client-side, avoiding them leave the browser completely. With beforeSend
or an eventProcessor
. If the error is dropped client-side, the Replay also never leaves the browser.
One situation that we identified (perhaps it's the same serious case @jiwon-mun mentioned that makes Replay unsable) is for NextJS apps that have orders of magnitude more Hydration errors than any legit error. Sentry is dropping these by default, through inbound filters and Replays, unaware, get sampled in. Resulting in all quota used up without any links to errors in Sentry.
Resulted in a lot of Replays without errors:
This is specially bad for customers with Shared On Demand on.
Relates to:
- https://github.com/getsentry/sentry-javascript/issues/10036
For folks with React ChunkLoadError or Hydration errors that don't want those sampled, a work around is to filter them client side:
Sentry.int({
inboundFilters: [
// filter react hydration errors
/reactjs\.org\/docs\/error-decoder\.html\?invariant=(418|419|422|423|425)/,
/(does not match server-rendered HTML|Hydration failed because)/i,
// filter chunk load errors
"ChunkLoadError: Loading chunk",
/Uncaught (.*): ChunkLoadError: Loading chunk/
]
});
Related: Generic inbound filters has been released: https://github.com/getsentry/sentry/issues/57799#issuecomment-1983388370
Through https://github.com/getsentry/relay/pull/3420 we now have some types of inbound filters now also applying to Replays. For example:
- IP Address
- Releases
- Request URL
- User-Agent
For other types of filters we'll need to further expand this capability
Pending documentation here and since this is live and users see a drop in accepted replay and a much more significant increase in filtered replays. That's because we count each filtered segment, where when we count an accepted replay, we only count 1 segment.