From 91a532f90a796fe926313db0d95dfa0139e649f2 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Fri, 16 Oct 2026 17:55:19 -0700 Subject: [PATCH 1/7] docs(js): Document nodeCronIntegration for Crons Co-Authored-By: Claude --- ...-crons-automatic-crons-instrumentation.mdx | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/includes/javascript-crons-automatic-crons-instrumentation.mdx b/includes/javascript-crons-automatic-crons-instrumentation.mdx index 8b78d165e0cf2..c9d7f216ebca4 100644 --- a/includes/javascript-crons-automatic-crons-instrumentation.mdx +++ b/includes/javascript-crons-automatic-crons-instrumentation.mdx @@ -45,6 +45,36 @@ cronWithCheckIn.schedule( ); ``` +#### Monitor All Named Tasks + +Requires SDK version `11.5.0` or higher. + +Instead of wrapping `node-cron`, you can add `nodeCronIntegration` to monitor every task that has a `name`, without changing how you import `node-cron`: + +```JavaScript +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [ + Sentry.nodeCronIntegration({ + excludeJobs: ["cleanup-temp-files", /^debug-/], // Optional. + }), + ], +}); +``` + +```JavaScript +import cron from "node-cron"; + +cron.schedule("0 9 * * 1-5", sendReport, { + name: "daily-report", + timezone: "Europe/Vienna", +}); +``` + +The monitor slug is the task's `name`. Tasks without a `name` aren't monitored. `excludeJobs` skips tasks whose name matches a string exactly or a regular expression. + +Each check-in sends the task's schedule and time zone (your server's time zone if `timezone` isn't set). Schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds) check in without a monitor config, so create those monitors in Sentry first. + ### Node Schedule Requires SDK version `7.93.0` or higher. From 0c07af9abc202e6db9acf21b615879237effe474 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Mon, 19 Oct 2026 17:49:09 -0700 Subject: [PATCH 2/7] docs(js): Recommend monitoring all node-cron tasks first Co-Authored-By: Claude --- ...-crons-automatic-crons-instrumentation.mdx | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/includes/javascript-crons-automatic-crons-instrumentation.mdx b/includes/javascript-crons-automatic-crons-instrumentation.mdx index c9d7f216ebca4..8386cb29182fd 100644 --- a/includes/javascript-crons-automatic-crons-instrumentation.mdx +++ b/includes/javascript-crons-automatic-crons-instrumentation.mdx @@ -27,29 +27,11 @@ const job = CronJobWithCheckIn.from({ ### Node Cron -Requires SDK version `7.92.0` or higher. - -Use `Sentry.cron.instrumentNodeCron` to instrument the `cron` export from the [`node-cron`](https://www.npmjs.com/package/node-cron) library. This returns an object with the same API as the original `cron` export, but with the `schedule` method instrumented. You can pass the name of the cron monitor and an optional time zone as part of the third options argument to the function. - -```JavaScript -import cron from "node-cron"; - -const cronWithCheckIn = Sentry.cron.instrumentNodeCron(cron); - -cronWithCheckIn.schedule( - "* * * * *", - () => { - console.log("running a task every minute"); - }, - { name: "my-cron-job" } -); -``` - #### Monitor All Named Tasks Requires SDK version `11.5.0` or higher. -Instead of wrapping `node-cron`, you can add `nodeCronIntegration` to monitor every task that has a `name`, without changing how you import `node-cron`: +We recommend adding `nodeCronIntegration`, which monitors every task that has a `name`, without changing how you import `node-cron`: ```JavaScript Sentry.init({ @@ -75,6 +57,28 @@ The monitor slug is the task's `name`. Tasks without a `name` aren't monitored. Each check-in sends the task's schedule and time zone (your server's time zone if `timezone` isn't set). Schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds) check in without a monitor config, so create those monitors in Sentry first. +#### Monitor Specific Tasks + +Requires SDK version `7.92.0` or higher. + +Use `Sentry.cron.instrumentNodeCron` to instrument the `cron` export from the [`node-cron`](https://www.npmjs.com/package/node-cron) library. This returns an object with the same API as the original `cron` export, but with the `schedule` method instrumented. You can pass the name of the cron monitor and an optional time zone as part of the third options argument to the function. + +```JavaScript +import cron from "node-cron"; + +const cronWithCheckIn = Sentry.cron.instrumentNodeCron(cron); + +cronWithCheckIn.schedule( + "* * * * *", + () => { + console.log("running a task every minute"); + }, + { name: "my-cron-job" } +); +``` + +`nodeCronIntegration` skips tasks created with `instrumentNodeCron`, so using both doesn't send duplicate check-ins. + ### Node Schedule Requires SDK version `7.93.0` or higher. From 57e09758616e5fd1fc4acc03573b962720a7d28a Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Tue, 20 Oct 2026 10:49:31 -0700 Subject: [PATCH 3/7] docs(js): Require the next SDK release for nodeCronIntegration Co-Authored-By: Claude --- includes/javascript-crons-automatic-crons-instrumentation.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/javascript-crons-automatic-crons-instrumentation.mdx b/includes/javascript-crons-automatic-crons-instrumentation.mdx index 8386cb29182fd..a78e57351965c 100644 --- a/includes/javascript-crons-automatic-crons-instrumentation.mdx +++ b/includes/javascript-crons-automatic-crons-instrumentation.mdx @@ -29,7 +29,7 @@ const job = CronJobWithCheckIn.from({ #### Monitor All Named Tasks -Requires SDK version `11.5.0` or higher. +Requires SDK version `11.9.0` or higher. We recommend adding `nodeCronIntegration`, which monitors every task that has a `name`, without changing how you import `node-cron`: From dd1634467654e417457927d122b980aa4b04547f Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Thu, 29 Oct 2026 11:04:39 -0700 Subject: [PATCH 4/7] docs(js): Skip node-cron tasks with unsupported schedules --- includes/javascript-crons-automatic-crons-instrumentation.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/javascript-crons-automatic-crons-instrumentation.mdx b/includes/javascript-crons-automatic-crons-instrumentation.mdx index a78e57351965c..08fc78aaa9660 100644 --- a/includes/javascript-crons-automatic-crons-instrumentation.mdx +++ b/includes/javascript-crons-automatic-crons-instrumentation.mdx @@ -55,7 +55,7 @@ cron.schedule("0 9 * * 1-5", sendReport, { The monitor slug is the task's `name`. Tasks without a `name` aren't monitored. `excludeJobs` skips tasks whose name matches a string exactly or a regular expression. -Each check-in sends the task's schedule and time zone (your server's time zone if `timezone` isn't set). Schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds) check in without a monitor config, so create those monitors in Sentry first. +Each check-in sends the task's schedule and time zone (your server's time zone if `timezone` isn't set). Schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds) aren't monitored. #### Monitor Specific Tasks From b370ab286c6cad194b2dc722bd0ae045c9d78cee Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Thu, 5 Nov 2026 09:15:57 -0500 Subject: [PATCH 5/7] docs(js): Set the SDK version to 11.11.0 --- includes/javascript-crons-automatic-crons-instrumentation.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/javascript-crons-automatic-crons-instrumentation.mdx b/includes/javascript-crons-automatic-crons-instrumentation.mdx index 08fc78aaa9660..a2864d376ae57 100644 --- a/includes/javascript-crons-automatic-crons-instrumentation.mdx +++ b/includes/javascript-crons-automatic-crons-instrumentation.mdx @@ -29,7 +29,7 @@ const job = CronJobWithCheckIn.from({ #### Monitor All Named Tasks -Requires SDK version `11.9.0` or higher. +Requires SDK version `11.11.0` or higher. We recommend adding `nodeCronIntegration`, which monitors every task that has a `name`, without changing how you import `node-cron`: From f6d2b1033b5851205460289def6d03f65be72653 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Wed, 11 Nov 2026 16:04:54 -0800 Subject: [PATCH 6/7] docs(js): Note the 2-minute margin for node-cron seconds Co-Authored-By: Claude Opus 5.5 --- includes/javascript-crons-automatic-crons-instrumentation.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/javascript-crons-automatic-crons-instrumentation.mdx b/includes/javascript-crons-automatic-crons-instrumentation.mdx index a2864d376ae57..70947347e49eb 100644 --- a/includes/javascript-crons-automatic-crons-instrumentation.mdx +++ b/includes/javascript-crons-automatic-crons-instrumentation.mdx @@ -55,7 +55,7 @@ cron.schedule("0 9 * * 1-5", sendReport, { The monitor slug is the task's `name`. Tasks without a `name` aren't monitored. `excludeJobs` skips tasks whose name matches a string exactly or a regular expression. -Each check-in sends the task's schedule and time zone (your server's time zone if `timezone` isn't set). Schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds) aren't monitored. +Each check-in sends the task's schedule and time zone (your server's time zone if `timezone` isn't set). Schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds) aren't monitored. If the seconds field isn't `0`, a check-in margin of 2 minutes is sent too, since the job checks in up to 59 seconds after the minute Sentry expects. This replaces a margin set in Sentry. #### Monitor Specific Tasks From cba81380a2ec8eb11116b21a8bd9a90bd683e9a7 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Wed, 11 Nov 2026 16:30:10 -0800 Subject: [PATCH 7/7] docs(js): Say which release sends the node-cron seconds margin Co-Authored-By: Claude Opus 5.5 --- includes/javascript-crons-automatic-crons-instrumentation.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/javascript-crons-automatic-crons-instrumentation.mdx b/includes/javascript-crons-automatic-crons-instrumentation.mdx index 70947347e49eb..54803752737ec 100644 --- a/includes/javascript-crons-automatic-crons-instrumentation.mdx +++ b/includes/javascript-crons-automatic-crons-instrumentation.mdx @@ -55,7 +55,7 @@ cron.schedule("0 9 * * 1-5", sendReport, { The monitor slug is the task's `name`. Tasks without a `name` aren't monitored. `excludeJobs` skips tasks whose name matches a string exactly or a regular expression. -Each check-in sends the task's schedule and time zone (your server's time zone if `timezone` isn't set). Schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds) aren't monitored. If the seconds field isn't `0`, a check-in margin of 2 minutes is sent too, since the job checks in up to 59 seconds after the minute Sentry expects. This replaces a margin set in Sentry. +Each check-in sends the task's schedule and time zone (your server's time zone if `timezone` isn't set). Schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds) aren't monitored. From the next SDK release after `11.12.0`, if the seconds field isn't `0`, a check-in margin of 2 minutes is sent too, since the job checks in up to 59 seconds after the minute Sentry expects. This replaces a margin set in Sentry. #### Monitor Specific Tasks