arabold / serverless-sentry-lib

MIT License
32 stars 15 forks source link

Sentry - Event filtering #28

Closed AlexSun98 closed 4 years ago

AlexSun98 commented 4 years ago

Is there anyway to use event filtering with the lib?

`import * as Sentry from "@sentry/browser";

init({ beforeSend(event, hint) { const error = hint.originalException; if ( error && error.message && error.message.match(/database unavailable/i) ) { event.fingerprint = ["database-unavailable"]; } return event; }, });`

arabold commented 4 years ago

Yes, you can pass any custom Sentry options as sentryOptions param to the withSentry function like this:

withSentry({
  sentryOptions: { 
    beforeSend: (event, hint) => {
      // ...
    }
  } 
}, handler);

Please let me know if this works.

SonnyFishback commented 2 years ago

Yes, you can pass any custom Sentry options as sentryOptions param to the withSentry function like this:

withSentry({
  sentryOptions: { 
    beforeSend: (event, hint) => {
      // ...
    }
  } 
}, handler);

Please let me know if this works.

Where is this documented? @arabold