From 979a1ebbed9d756ac938ffbe5b1be55c3a0b1e61 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Fri, 16 Oct 2026 17:40:59 -0700 Subject: [PATCH 1/2] docs(crons): Add BullMQ job scheduler setup for Node Co-Authored-By: Claude --- ...-crons-automatic-crons-instrumentation.mdx | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/includes/javascript-crons-automatic-crons-instrumentation.mdx b/includes/javascript-crons-automatic-crons-instrumentation.mdx index 8b78d165e0cf2c..5d3f267b15eb02 100644 --- a/includes/javascript-crons-automatic-crons-instrumentation.mdx +++ b/includes/javascript-crons-automatic-crons-instrumentation.mdx @@ -1,4 +1,4 @@ -If you're using the [`cron`](https://www.npmjs.com/package/cron), [`node-cron`](https://www.npmjs.com/package/node-cron) or [`node-schedule`](https://www.npmjs.com/package/node-schedule) libraries to run your periodic tasks, you can use our instrumentation functions in the `Sentry.cron` export to monitor your cron jobs. These functions send the job's schedule with each check-in, so Sentry creates the monitor for you. +If you're using the [`cron`](https://www.npmjs.com/package/cron), [`node-cron`](https://www.npmjs.com/package/node-cron) or [`node-schedule`](https://www.npmjs.com/package/node-schedule) libraries to run your periodic tasks, or [BullMQ](https://www.npmjs.com/package/bullmq) job schedulers, you can use our instrumentation functions in the `Sentry.cron` export to monitor your cron jobs. These functions send the job's schedule with each check-in, so Sentry creates the monitor for you. ### Cron @@ -64,3 +64,32 @@ scheduleWithCheckIn.scheduleJob( } ); ``` + +### BullMQ + + + +BullMQ support ships in the next release of `@sentry/node`. + + + +Use `Sentry.cron.instrumentBullMQWorker` to send check-ins for every job a BullMQ `Worker` runs from a [job scheduler](https://docs.bullmq.io/guide/job-schedulers). The job scheduler ID is the monitor slug, and the scheduler's `pattern` or `every` is sent as the monitor schedule. Jobs that weren't created by a job scheduler aren't monitored. + +```JavaScript +import { Queue, Worker } from "bullmq"; + +const queue = new Queue("reports", { connection }); +await queue.upsertJobScheduler( + "daily-report", + { pattern: "0 9 * * 1-5", tz: "Europe/Vienna" }, + { name: "report" } +); + +const worker = new Worker("reports", processor, { connection }); +Sentry.cron.instrumentBullMQWorker(worker, { + // job scheduler IDs or regular expressions to skip + excludeJobSchedulers: ["cache-warmup", /^tmp-/], +}); +``` + +Sentry creates the monitor from `pattern` schedules and from `every` intervals that are a whole number of minutes. For schedules that can't be expressed in the Crons schedule format (for example, a job that runs every 10 seconds), schedulers with a `limit` or `endDate`, and time zones given as an offset like `UTC+5` rather than an IANA name like `Europe/Vienna`, the SDK sends check-ins without a monitor config, and you need to create the monitor in Sentry with the same slug. Repeatable jobs added with `queue.add` and the `repeat` option aren't monitored. From c6e37844d5ea67e4349582af74c44db8bae4edf7 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Tue, 20 Oct 2026 11:29:55 -0700 Subject: [PATCH 2/2] docs(crons): Use the SDK version line for BullMQ like the other sections Co-Authored-By: Claude --- .../javascript-crons-automatic-crons-instrumentation.mdx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/includes/javascript-crons-automatic-crons-instrumentation.mdx b/includes/javascript-crons-automatic-crons-instrumentation.mdx index 5d3f267b15eb02..6cda48bed48df0 100644 --- a/includes/javascript-crons-automatic-crons-instrumentation.mdx +++ b/includes/javascript-crons-automatic-crons-instrumentation.mdx @@ -67,11 +67,7 @@ scheduleWithCheckIn.scheduleJob( ### BullMQ - - -BullMQ support ships in the next release of `@sentry/node`. - - +Requires SDK version `11.9.0` or higher and `bullmq` version `5.16.0` or higher. Use `Sentry.cron.instrumentBullMQWorker` to send check-ins for every job a BullMQ `Worker` runs from a [job scheduler](https://docs.bullmq.io/guide/job-schedulers). The job scheduler ID is the monitor slug, and the scheduler's `pattern` or `every` is sent as the monitor schedule. Jobs that weren't created by a job scheduler aren't monitored.