diff --git a/includes/javascript-crons-automatic-crons-instrumentation.mdx b/includes/javascript-crons-automatic-crons-instrumentation.mdx index 858bf54039883..e3caefc7f7627 100644 --- a/includes/javascript-crons-automatic-crons-instrumentation.mdx +++ b/includes/javascript-crons-automatic-crons-instrumentation.mdx @@ -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.