sentry icon indicating copy to clipboard operation
sentry copied to clipboard

Replay: Allow Inbound Filters to apply to replays

Open bruno-garcia opened this issue 2 years ago • 5 comments

Problem Statement

Replays can capture some sessions that are noisy. Sentry has some inbound filters for errors but those don't apply image

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

bruno-garcia avatar Feb 15 '23 22:02 bruno-garcia

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 avatar Jul 26 '23 03:07 jiwon-mun

@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.

bruno-garcia avatar Jul 26 '23 13:07 bruno-garcia

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.

image

Resulted in a lot of Replays without errors: image

This is specially bad for customers with Shared On Demand on.

bruno-garcia avatar Dec 18 '23 18:12 bruno-garcia

Relates to:

  • https://github.com/getsentry/sentry-javascript/issues/10036

bruno-garcia avatar Feb 12 '24 16:02 bruno-garcia

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/
  ]
});

bruno-garcia avatar Feb 12 '24 16:02 bruno-garcia

Related: Generic inbound filters has been released: https://github.com/getsentry/sentry/issues/57799#issuecomment-1983388370

bruno-garcia avatar Mar 13 '24 15:03 bruno-garcia

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

bruno-garcia avatar Apr 17 '24 14:04 bruno-garcia

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.

bruno-garcia avatar Apr 24 '24 20:04 bruno-garcia