Sentry is used for error reporting and performance monitoring. It's especially helpful to alert on newly introduced crashing bugs and bad third-party integrations.
Sentry integration is configured in ./index.ts through its SDK.
Sentry performance traces are viewable in the performance dashboard. Most of the performance monitoring integration is done ./trace.ts and ./request.ts.
Sentry errors are viewable in the issues dashboard.
Most of the error reporting integration is done in the beforeSend function defined in ./errors.ts.
Sentry is configured to alert in https://sentry.io/alerts/rules/interface. Sentry alerting will page the web oncall.
For generic errors, Sentry is configured to alert when:
- Rolling 1-hour crash free session rate falls below a threshold
- Over 50 users have the same error in an hour
beforeSend is used to filter or to modify Sentry events.
Filtering Sentry events is done through shouldRejectError, and can be unit-tested without integration.
Modifying Sentry events is done on a per-event basis, and should be manually tested with Sentry to ensure the modified event shows up as expected (event name, fingerprint, etc.).
- Configure your
.envto enable localhost Sentry reporting:- Set
REACT_APP_SENTRY_DSNusing the "localhost (for testing only)". - Set
REACT_APP_SENTRY_ENABLED=true. - If you're testing tracing, set
REACT_APP_SENTRY_TRACES_SAMPLE_RATE=1.
- Set
- Enable the "localhost (for testing only)".
- Turn off the inbound filter for localhost events.
Make sure to turn the inbound filter back on and to disable the "localhost" key when you are done.
To test an unhandled error or rejection, you just need to create one in the console:
Promise.reject('this is an unhandled rejection')
// or
throw new Error('this is an unhandled error')You should then be able to see it in the "development" issues dashboard.