Use the Sentry.withMonitor()
API to monitor a callback and notify you if your periodic task is missed (or doesn't start when expected), if it fails due to a problem in the runtime (such as an error), or if it fails by exceeding its maximum runtime.
Sentry.withMonitor()
requires SDK version 7.76.0
.
Sentry.withMonitor("<monitor-slug>", () => {
// Execute your scheduled task here...
});
If you are using an SDK version prior to 7.76.0
, you can use the Sentry.captureCheckIn()
API documented below.