From d0232f2f855adeb3f1018e650b7bfda48d88caf8 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Fri, 2 Oct 2026 12:46:19 -0700 Subject: [PATCH 1/5] docs(nestjs): Document SentryCron monitor config from @Cron Co-Authored-By: Claude Opus 5.5 --- includes/nestjs-sentry-cron-decorator.mdx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/includes/nestjs-sentry-cron-decorator.mdx b/includes/nestjs-sentry-cron-decorator.mdx index d76734fbd7c86..db37526a8a261 100644 --- a/includes/nestjs-sentry-cron-decorator.mdx +++ b/includes/nestjs-sentry-cron-decorator.mdx @@ -29,3 +29,24 @@ export class MyCronService { } ``` + +### Monitor Config From `@Cron` + + + +If you don't pass a monitor config, `@SentryCron` takes the schedule and `timeZone` from the `@Cron` decorator on the same method and sends them with each check-in, so Sentry creates the monitor on the first run: + +```typescript +import { Cron } from '@nestjs/schedule'; +import { SentryCron } from '@sentry/nestjs'; + +export class MyCronService { + @Cron('0 * * * *', { timeZone: 'America/Los_Angeles' }) + @SentryCron('my-monitor-slug') + handleCron() { + // Your cron job logic here + } +} +``` + +A six-field expression is sent without its seconds field if that field is a single number, such as `0 30 9 * * *`. Sub-minute schedules, presets such as `@daily`, `Date` values, and `utcOffset` send no monitor config. In those cases, pass a monitor config to `@SentryCron` or create the monitor in Sentry first. A monitor config passed to `@SentryCron` always takes precedence. From 394cbaf83f793494db6aa0f348ad6511acc60cf5 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Fri, 2 Oct 2026 12:57:48 -0700 Subject: [PATCH 2/5] docs(nestjs): Show fromCronDecorator opt-in for SentryCron Co-Authored-By: Claude Opus 5.5 --- includes/nestjs-sentry-cron-decorator.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/nestjs-sentry-cron-decorator.mdx b/includes/nestjs-sentry-cron-decorator.mdx index db37526a8a261..178c86b125db0 100644 --- a/includes/nestjs-sentry-cron-decorator.mdx +++ b/includes/nestjs-sentry-cron-decorator.mdx @@ -34,7 +34,7 @@ export class MyCronService { -If you don't pass a monitor config, `@SentryCron` takes the schedule and `timeZone` from the `@Cron` decorator on the same method and sends them with each check-in, so Sentry creates the monitor on the first run: +Instead of repeating the schedule, pass `{ fromCronDecorator: true }` to `@SentryCron`. It then takes the schedule and `timeZone` from the `@Cron` decorator on the same method and sends them with each check-in, so Sentry creates the monitor on the first run. You can set other monitor options, such as `checkinMargin` and `maxRuntime`, next to it: ```typescript import { Cron } from '@nestjs/schedule'; @@ -42,11 +42,11 @@ import { SentryCron } from '@sentry/nestjs'; export class MyCronService { @Cron('0 * * * *', { timeZone: 'America/Los_Angeles' }) - @SentryCron('my-monitor-slug') + @SentryCron('my-monitor-slug', { fromCronDecorator: true, checkinMargin: 2 }) handleCron() { // Your cron job logic here } } ``` -A six-field expression is sent without its seconds field if that field is a single number, such as `0 30 9 * * *`. Sub-minute schedules, presets such as `@daily`, `Date` values, and `utcOffset` send no monitor config. In those cases, pass a monitor config to `@SentryCron` or create the monitor in Sentry first. A monitor config passed to `@SentryCron` always takes precedence. +A six-field expression is sent without its seconds field if that field is a single number, such as `0 30 9 * * *`. Sub-minute schedules, presets such as `@daily`, `Date` values, and `utcOffset` send no monitor config. In those cases, pass a full monitor config to `@SentryCron` or create the monitor in Sentry first. From eb6bf60899f3e26ca3441cbb4e4438b3e3db21e1 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Fri, 2 Oct 2026 13:09:08 -0700 Subject: [PATCH 3/5] docs(nestjs): SentryCron sends the @Cron schedule by default Co-Authored-By: Claude Opus 5.5 --- includes/nestjs-sentry-cron-decorator.mdx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/nestjs-sentry-cron-decorator.mdx b/includes/nestjs-sentry-cron-decorator.mdx index 178c86b125db0..5f5b993e260ab 100644 --- a/includes/nestjs-sentry-cron-decorator.mdx +++ b/includes/nestjs-sentry-cron-decorator.mdx @@ -34,7 +34,7 @@ export class MyCronService { -Instead of repeating the schedule, pass `{ fromCronDecorator: true }` to `@SentryCron`. It then takes the schedule and `timeZone` from the `@Cron` decorator on the same method and sends them with each check-in, so Sentry creates the monitor on the first run. You can set other monitor options, such as `checkinMargin` and `maxRuntime`, next to it: +If you don't pass a monitor config with a `schedule`, `@SentryCron` sends the schedule and time zone of the `@Cron` decorator on the same method with each check-in, so Sentry creates the monitor on the first run. You can still pass other monitor options, such as `checkinMargin` and `maxRuntime`: ```typescript import { Cron } from '@nestjs/schedule'; @@ -42,11 +42,15 @@ import { SentryCron } from '@sentry/nestjs'; export class MyCronService { @Cron('0 * * * *', { timeZone: 'America/Los_Angeles' }) - @SentryCron('my-monitor-slug', { fromCronDecorator: true, checkinMargin: 2 }) + @SentryCron('my-monitor-slug', { checkinMargin: 2 }) handleCron() { // Your cron job logic here } } ``` +If `@Cron` has no `timeZone`, the job runs in your server's local time zone, so that time zone is sent. + A six-field expression is sent without its seconds field if that field is a single number, such as `0 30 9 * * *`. Sub-minute schedules, presets such as `@daily`, `Date` values, and `utcOffset` send no monitor config. In those cases, pass a full monitor config to `@SentryCron` or create the monitor in Sentry first. + +To send check-ins without a monitor config, pass `{ fromCronDecorator: false }`. From 908b14c280800023f4530be5d227fa8f818c5e1b Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Fri, 2 Oct 2026 13:28:21 -0700 Subject: [PATCH 4/5] docs(nestjs): Note that @Cron presets are sent Co-Authored-By: Claude Opus 5.5 --- includes/nestjs-sentry-cron-decorator.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/nestjs-sentry-cron-decorator.mdx b/includes/nestjs-sentry-cron-decorator.mdx index 5f5b993e260ab..81bceef4f023d 100644 --- a/includes/nestjs-sentry-cron-decorator.mdx +++ b/includes/nestjs-sentry-cron-decorator.mdx @@ -51,6 +51,6 @@ export class MyCronService { If `@Cron` has no `timeZone`, the job runs in your server's local time zone, so that time zone is sent. -A six-field expression is sent without its seconds field if that field is a single number, such as `0 30 9 * * *`. Sub-minute schedules, presets such as `@daily`, `Date` values, and `utcOffset` send no monitor config. In those cases, pass a full monitor config to `@SentryCron` or create the monitor in Sentry first. +A six-field expression is sent without its seconds field if that field is a single number, such as `0 30 9 * * *`. Presets such as `@daily` and `@weekly` are sent too. Sub-minute schedules, `Date` values, and `utcOffset` send no monitor config, including any other options you pass. In those cases, pass a full monitor config to `@SentryCron` or create the monitor in Sentry first. To send check-ins without a monitor config, pass `{ fromCronDecorator: false }`. From d33c58d533945c00cec71b71866bc4e34981038f Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Fri, 2 Oct 2026 15:02:23 -0700 Subject: [PATCH 5/5] docs(nestjs): List more @Cron schedules that send no monitor config Co-Authored-By: Claude --- includes/nestjs-sentry-cron-decorator.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/nestjs-sentry-cron-decorator.mdx b/includes/nestjs-sentry-cron-decorator.mdx index 81bceef4f023d..5db65583951ee 100644 --- a/includes/nestjs-sentry-cron-decorator.mdx +++ b/includes/nestjs-sentry-cron-decorator.mdx @@ -51,6 +51,6 @@ export class MyCronService { If `@Cron` has no `timeZone`, the job runs in your server's local time zone, so that time zone is sent. -A six-field expression is sent without its seconds field if that field is a single number, such as `0 30 9 * * *`. Presets such as `@daily` and `@weekly` are sent too. Sub-minute schedules, `Date` values, and `utcOffset` send no monitor config, including any other options you pass. In those cases, pass a full monitor config to `@SentryCron` or create the monitor in Sentry first. +A six-field expression is sent without its seconds field if that field is a single number, such as `0 30 9 * * *`. Presets such as `@daily` and `@weekly` are sent too. Sub-minute schedules, `Date` values, `utcOffset`, numeric months (use names such as `MAY`), a `*/n` day field combined with the other day field, and time zones that aren't IANA names send no monitor config, including any other options you pass. In those cases, pass a full monitor config to `@SentryCron` or create the monitor in Sentry first. To send check-ins without a monitor config, pass `{ fromCronDecorator: false }`.