sentry

Apply rate limiting for sentry server


How to apply rate limiting when the sentry server is overloaded

My Sentry init code

Sentry.init({
   app,
   dsn: '...',
   integrations: [new BrowserTracing({ tracingOrigins: ['*'] })],
   tracesSampleRate: 0.2,
   autoSessionTracking: false,
   enabled: import.meta.env.VITE_MODE === 'PROD',
   ignoreErrors: ['TypeError', 'Unable to preload', 'timeout', 'Invalid Date'],
});

Or how to reduce Sentry server load


Solution

  • Depending on which SDK you're using you might have slightly different options available. I'm familiar with the .NET SDK that has various filtering capabilities that you could use to dynamically filter events in your application before they get sent to Sentry. I think most of the SDKs (Flutter, Javascript, Python etc.) have equivalent capability though.

    Alternatively, Dynamic sampling might be another option.