Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions includes/javascript-crons-automatic-crons-instrumentation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,25 @@ scheduleWithCheckIn.scheduleJob(
```

`nodeScheduleIntegration` skips jobs created with `instrumentNodeSchedule`, so using both doesn't send duplicate check-ins.

### Graphile Worker

Requires SDK version `11.9.0` or higher and `graphile-worker` version `0.16` to `0.18`.

Use `Sentry.graphileWorkerIntegration` to monitor the jobs that the [`graphile-worker`](https://www.npmjs.com/package/graphile-worker) crontab schedules:

```JavaScript
Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [
Sentry.graphileWorkerIntegration({
monitorCronJobs: true,
excludeCronJobs: ["cleanup", /^dev_/], // Optional.
}),
],
});
```

The monitor slug is the crontab item's identifier: its `id` option, or the task name if there's no `id`. `excludeCronJobs` skips items whose identifier matches a string exactly or a regular expression. Jobs are monitored by a process that runs the crontab, which `run()` does by default. Failed runs send an `error` check-in and report the error to Sentry.

Check-ins are sent without a schedule, so create the monitors in Sentry first.
Loading