From ee37653e0b8806e0b0490bf32e27166055763dd1 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Fri, 16 Oct 2026 17:57:23 -0700 Subject: [PATCH 1/8] docs(php): Document monitoring all Laravel scheduled tasks Co-Authored-By: Claude --- platform-includes/crons/setup/php.laravel.mdx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/platform-includes/crons/setup/php.laravel.mdx b/platform-includes/crons/setup/php.laravel.mdx index 303d146d4fe46..68eda749ba7ac 100644 --- a/platform-includes/crons/setup/php.laravel.mdx +++ b/platform-includes/crons/setup/php.laravel.mdx @@ -22,6 +22,29 @@ protected function schedule(Schedule $schedule) Tasks that use Laravel's `between`, `unlessBetween`, `when` and `skip` methods are currently not supported. For the best results, we recommend using Laravel's [`cron`](https://laravel.com/docs/10.x/scheduling#schedule-frequency-options) method to define your schedule's frequency. +### Monitor All Scheduled Tasks + + + +This option ships in the next release of `sentry/sentry-laravel`. + + + +To monitor every scheduled task without adding `sentryMonitor()` to each one, turn on `monitor_scheduled_tasks` in your Sentry config. (Please note, this creates a Cron monitor for every scheduled task, which counts against your quota.) + +```php {filename:config/sentry.php} +'crons' => [ + 'monitor_scheduled_tasks' => env('SENTRY_CRONS_MONITOR_SCHEDULED_TASKS', false), + + // Commands, job classes, task names or monitor slugs to skip, `*` is a wildcard + 'exclude_scheduled_tasks' => ['horizon:snapshot', 'scheduled_reports-*'], +], +``` + +Each task is monitored as if you'd called `sentryMonitor()` on it. Tasks that already call `sentryMonitor()` keep their own settings, and closures without a `name()` aren't monitored. Tasks that run the same command on different schedules get a short hash of their schedule added to the slug. + +For tasks that use `between`, `unlessBetween`, `when` or `skip`, and for schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds), the SDK sends check-ins without a schedule, and you need to create the monitor in Sentry with the same slug. + ## Configure a Job Monitor By default, the Laravel SDK will infer various parameters of your scheduled task. From 1966b61db25ed08b7529bb24fb99a4d436729a47 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Mon, 19 Oct 2026 17:50:20 -0700 Subject: [PATCH 2/8] docs(php): Recommend monitoring all Laravel scheduled tasks first Co-Authored-By: Claude --- platform-includes/crons/setup/php.laravel.mdx | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/platform-includes/crons/setup/php.laravel.mdx b/platform-includes/crons/setup/php.laravel.mdx index 68eda749ba7ac..3a186c3456530 100644 --- a/platform-includes/crons/setup/php.laravel.mdx +++ b/platform-includes/crons/setup/php.laravel.mdx @@ -2,26 +2,6 @@ Use the Laravel SDK to monitor and notify you if your [scheduled task](https://laravel.com/docs/10.x/scheduling) is missed (or doesn't start when expected), if it fails due to a problem in the runtime (such as an error), or if it fails by exceeding its maximum runtime. -To set up, add the `sentryMonitor()` macro to the scheduled tasks defined in your application as shown below. (Please note, this will create a Cron monitor that will count against your quota.) - -```php {tabTitle:Laravel 12.x & 11.x} {mdExpandTabs} {filename:routes/console.php} -Schedule::command(SendEmailsCommand::class) - ->everyHour() - ->sentryMonitor(); // add this line -``` - -```php {tabTitle:Laravel 10.x & 9.x & 8.x} {filename:app/Console/Kernel.php} -protected function schedule(Schedule $schedule) -{ - $schedule->command('emails:send') - ->everyHour() - ->sentryMonitor(); // add this line -} -``` - -Tasks that use Laravel's `between`, `unlessBetween`, `when` and `skip` methods are currently not supported. -For the best results, we recommend using Laravel's [`cron`](https://laravel.com/docs/10.x/scheduling#schedule-frequency-options) method to define your schedule's frequency. - ### Monitor All Scheduled Tasks @@ -30,7 +10,7 @@ This option ships in the next release of `sentry/sentry-laravel`. -To monitor every scheduled task without adding `sentryMonitor()` to each one, turn on `monitor_scheduled_tasks` in your Sentry config. (Please note, this creates a Cron monitor for every scheduled task, which counts against your quota.) +We recommend monitoring every scheduled task. To do this without adding `sentryMonitor()` to each one, turn on `monitor_scheduled_tasks` in your Sentry config. (Please note, this creates a Cron monitor for every scheduled task, which counts against your quota.) ```php {filename:config/sentry.php} 'crons' => [ @@ -45,6 +25,30 @@ Each task is monitored as if you'd called `sentryMonitor()` on it. Tasks that al For tasks that use `between`, `unlessBetween`, `when` or `skip`, and for schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds), the SDK sends check-ins without a schedule, and you need to create the monitor in Sentry with the same slug. +### Monitor Specific Tasks + +To monitor specific tasks, add the `sentryMonitor()` macro to them as shown below. (Please note, this will create a Cron monitor that will count against your quota.) + +```php {tabTitle:Laravel 12.x & 11.x} {mdExpandTabs} {filename:routes/console.php} +Schedule::command(SendEmailsCommand::class) + ->everyHour() + ->sentryMonitor(); // add this line +``` + +```php {tabTitle:Laravel 10.x & 9.x & 8.x} {filename:app/Console/Kernel.php} +protected function schedule(Schedule $schedule) +{ + $schedule->command('emails:send') + ->everyHour() + ->sentryMonitor(); // add this line +} +``` + +Tasks that use Laravel's `between`, `unlessBetween`, `when` and `skip` methods are currently not supported. +For the best results, we recommend using Laravel's [`cron`](https://laravel.com/docs/10.x/scheduling#schedule-frequency-options) method to define your schedule's frequency. + +With `monitor_scheduled_tasks` on, a task that calls `sentryMonitor()` is only monitored once, with its own settings. + ## Configure a Job Monitor By default, the Laravel SDK will infer various parameters of your scheduled task. From 6bbe9e872d1092c8ab862e2a800ee83337eff2f5 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Tue, 20 Oct 2026 10:43:45 -0700 Subject: [PATCH 3/8] docs(php): Note timezone handling for monitoring all Laravel scheduled tasks Co-Authored-By: Claude --- platform-includes/crons/setup/php.laravel.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform-includes/crons/setup/php.laravel.mdx b/platform-includes/crons/setup/php.laravel.mdx index 3a186c3456530..c5e7bc3d35f65 100644 --- a/platform-includes/crons/setup/php.laravel.mdx +++ b/platform-includes/crons/setup/php.laravel.mdx @@ -21,9 +21,9 @@ We recommend monitoring every scheduled task. To do this without adding `sentryM ], ``` -Each task is monitored as if you'd called `sentryMonitor()` on it. Tasks that already call `sentryMonitor()` keep their own settings, and closures without a `name()` aren't monitored. Tasks that run the same command on different schedules get a short hash of their schedule added to the slug. +Each task is monitored as if you'd called `sentryMonitor()` on it. Tasks that already call `sentryMonitor()` keep their own settings, and closures without a `name()` aren't monitored. Tasks that run the same command on different schedules or in different timezones get a short hash of their schedule added to the slug. -For tasks that use `between`, `unlessBetween`, `when` or `skip`, and for schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds), the SDK sends check-ins without a schedule, and you need to create the monitor in Sentry with the same slug. +For tasks that use `between`, `unlessBetween`, `when` or `skip`, tasks without a `timezone()` when the app's timezone isn't UTC, and schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds), the SDK sends check-ins without a schedule, and you need to create the monitor in Sentry with the same slug. ### Monitor Specific Tasks From 4099caa7ba7b0b85051067a72e46132cf4e41ff9 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Wed, 21 Oct 2026 08:59:41 -0700 Subject: [PATCH 4/8] docs(php): Note hashing of long Laravel scheduled task slugs Co-Authored-By: Claude --- platform-includes/crons/setup/php.laravel.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/crons/setup/php.laravel.mdx b/platform-includes/crons/setup/php.laravel.mdx index c5e7bc3d35f65..ad9bdf90f55e7 100644 --- a/platform-includes/crons/setup/php.laravel.mdx +++ b/platform-includes/crons/setup/php.laravel.mdx @@ -21,7 +21,7 @@ We recommend monitoring every scheduled task. To do this without adding `sentryM ], ``` -Each task is monitored as if you'd called `sentryMonitor()` on it. Tasks that already call `sentryMonitor()` keep their own settings, and closures without a `name()` aren't monitored. Tasks that run the same command on different schedules or in different timezones get a short hash of their schedule added to the slug. +Each task is monitored as if you'd called `sentryMonitor()` on it. Tasks that already call `sentryMonitor()` keep their own settings, and closures without a `name()` aren't monitored. Tasks that run the same command on different schedules or in different timezones get a short hash of their schedule added to the slug. Slugs longer than 50 characters are shortened and end in a short hash of the full name. For tasks that use `between`, `unlessBetween`, `when` or `skip`, tasks without a `timezone()` when the app's timezone isn't UTC, and schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds), the SDK sends check-ins without a schedule, and you need to create the monitor in Sentry with the same slug. From f20ce88551e5b787660dd8d094d020b642499e56 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Thu, 22 Oct 2026 10:31:53 -0700 Subject: [PATCH 5/8] docs(php): Describe how Laravel handles scheduled tasks that share a slug --- platform-includes/crons/setup/php.laravel.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/crons/setup/php.laravel.mdx b/platform-includes/crons/setup/php.laravel.mdx index ad9bdf90f55e7..a1ca723c4c642 100644 --- a/platform-includes/crons/setup/php.laravel.mdx +++ b/platform-includes/crons/setup/php.laravel.mdx @@ -21,7 +21,7 @@ We recommend monitoring every scheduled task. To do this without adding `sentryM ], ``` -Each task is monitored as if you'd called `sentryMonitor()` on it. Tasks that already call `sentryMonitor()` keep their own settings, and closures without a `name()` aren't monitored. Tasks that run the same command on different schedules or in different timezones get a short hash of their schedule added to the slug. Slugs longer than 50 characters are shortened and end in a short hash of the full name. +Each task is monitored as if you'd called `sentryMonitor()` on it. Tasks that already call `sentryMonitor()` keep their own settings, and closures without a `name()` aren't monitored. Tasks that share a slug, such as the same command on different schedules, aren't monitored and a warning is logged. Give each of them a unique slug with `->sentryMonitor('your-monitor-slug')`. Slugs longer than 50 characters are shortened and end in a short hash of the full name. For tasks that use `between`, `unlessBetween`, `when` or `skip`, tasks without a `timezone()` when the app's timezone isn't UTC, and schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds), the SDK sends check-ins without a schedule, and you need to create the monitor in Sentry with the same slug. From 2cc12813ef052ecb2488530e8d85527324b91c4d Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Thu, 29 Oct 2026 11:00:42 -0700 Subject: [PATCH 6/8] fix(crons): Laravel tasks with unsupported schedules aren't monitored automatically --- platform-includes/crons/setup/php.laravel.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/crons/setup/php.laravel.mdx b/platform-includes/crons/setup/php.laravel.mdx index a1ca723c4c642..ff1fe9dd0e5e4 100644 --- a/platform-includes/crons/setup/php.laravel.mdx +++ b/platform-includes/crons/setup/php.laravel.mdx @@ -23,7 +23,7 @@ We recommend monitoring every scheduled task. To do this without adding `sentryM Each task is monitored as if you'd called `sentryMonitor()` on it. Tasks that already call `sentryMonitor()` keep their own settings, and closures without a `name()` aren't monitored. Tasks that share a slug, such as the same command on different schedules, aren't monitored and a warning is logged. Give each of them a unique slug with `->sentryMonitor('your-monitor-slug')`. Slugs longer than 50 characters are shortened and end in a short hash of the full name. -For tasks that use `between`, `unlessBetween`, `when` or `skip`, tasks without a `timezone()` when the app's timezone isn't UTC, and schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds), the SDK sends check-ins without a schedule, and you need to create the monitor in Sentry with the same slug. +For tasks that use `between`, `unlessBetween`, `when` or `skip`, tasks without a `timezone()` when the app's timezone isn't UTC, and schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds), aren't monitored automatically. To monitor one of them, add `->sentryMonitor()` to it and create the monitor in Sentry with the same slug. ### Monitor Specific Tasks From eed9a0c6bf720ee5292101a06ef4e15d396ea8a7 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Thu, 29 Oct 2026 11:01:01 -0700 Subject: [PATCH 7/8] fix(crons): Fix wording for Laravel tasks that aren't monitored automatically --- platform-includes/crons/setup/php.laravel.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/crons/setup/php.laravel.mdx b/platform-includes/crons/setup/php.laravel.mdx index ff1fe9dd0e5e4..8afe0bb3ffd5c 100644 --- a/platform-includes/crons/setup/php.laravel.mdx +++ b/platform-includes/crons/setup/php.laravel.mdx @@ -23,7 +23,7 @@ We recommend monitoring every scheduled task. To do this without adding `sentryM Each task is monitored as if you'd called `sentryMonitor()` on it. Tasks that already call `sentryMonitor()` keep their own settings, and closures without a `name()` aren't monitored. Tasks that share a slug, such as the same command on different schedules, aren't monitored and a warning is logged. Give each of them a unique slug with `->sentryMonitor('your-monitor-slug')`. Slugs longer than 50 characters are shortened and end in a short hash of the full name. -For tasks that use `between`, `unlessBetween`, `when` or `skip`, tasks without a `timezone()` when the app's timezone isn't UTC, and schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds), aren't monitored automatically. To monitor one of them, add `->sentryMonitor()` to it and create the monitor in Sentry with the same slug. +Tasks that use `between`, `unlessBetween`, `when` or `skip`, tasks without a `timezone()` when the app's timezone isn't UTC, and tasks with schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds) aren't monitored automatically. To monitor one of them, add `->sentryMonitor()` with `updateMonitorConfig: false` and create the monitor in Sentry with the same slug. ### Monitor Specific Tasks From 1c10c6ef234475c47c441d3fd204a0fab2c2377b Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Thu, 12 Nov 2026 03:24:36 -0800 Subject: [PATCH 8/8] docs(php): Laravel monitor_scheduled_tasks is available in 4.30.0 --- platform-includes/crons/setup/php.laravel.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform-includes/crons/setup/php.laravel.mdx b/platform-includes/crons/setup/php.laravel.mdx index 8afe0bb3ffd5c..759940abfdc72 100644 --- a/platform-includes/crons/setup/php.laravel.mdx +++ b/platform-includes/crons/setup/php.laravel.mdx @@ -6,7 +6,7 @@ Use the Laravel SDK to monitor and notify you if your [scheduled task](https://l -This option ships in the next release of `sentry/sentry-laravel`. +This option is available in Sentry Laravel SDK version `4.30.0` and above. @@ -23,7 +23,7 @@ We recommend monitoring every scheduled task. To do this without adding `sentryM Each task is monitored as if you'd called `sentryMonitor()` on it. Tasks that already call `sentryMonitor()` keep their own settings, and closures without a `name()` aren't monitored. Tasks that share a slug, such as the same command on different schedules, aren't monitored and a warning is logged. Give each of them a unique slug with `->sentryMonitor('your-monitor-slug')`. Slugs longer than 50 characters are shortened and end in a short hash of the full name. -Tasks that use `between`, `unlessBetween`, `when` or `skip`, tasks without a `timezone()` when the app's timezone isn't UTC, and tasks with schedules that can't be expressed in the Crons schedule format (for example, a task that runs every 10 seconds) aren't monitored automatically. To monitor one of them, add `->sentryMonitor()` with `updateMonitorConfig: false` and create the monitor in Sentry with the same slug. +Tasks that use `between`, `unlessBetween`, `when` or `skip`, tasks with a timezone offset instead of a timezone name, tasks without a `timezone()` when the app's timezone isn't UTC, and tasks with schedules that Sentry can't express or would read differently (for example, a task that runs every 10 seconds) aren't monitored automatically. To monitor one of them, add `->sentryMonitor('your-monitor-slug', updateMonitorConfig: false)` and create a monitor in Sentry with that slug. ### Monitor Specific Tasks