Docs › Laravel scheduler monitoring with RunVouch
Laravel scheduler monitoring with RunVouch
Laravel scheduler monitoring for the cron line that is not there: Schedule::command("report:build")->dailyAt("02:00") only runs if php artisan schedule:run is called every minute by cron. The docs' crontab line ends in >> /dev/null 2>&1, so the scheduler's own output is discarded too.
How it runs on Laravel task scheduler
Two options. Per task: Schedule::exec() with rv run wrapping the artisan command, so each run has an exit code and evidence. For the scheduler as a whole: wrap schedule:run itself with a 1-minute cadence agent when what you need to know is that cron is alive.
Store the key
RUNVOUCH_KEY in .env (read by the cron environment through Laravel), or in the crontab line's environment. Do not put it in config/ under version control.
Wrap the job
# system crontab (the one line everything depends on)
* * * * * cd /srv/app && php artisan schedule:run >> /dev/null 2>&1
# routes/console.php (Laravel 11+; app/Console/Kernel.php on 10)
use Illuminate\Support\Facades\Schedule;
Schedule::exec('rv run nightly-report --evidence-file storage/app/report.html -- php artisan report:build')
->dailyAt('02:00')
->withoutOverlapping()
->onOneServer()
->environments(['production']);
# or, if you would rather not shell out: the two HTTP calls inside the command's handle()
# Http::withHeaders(['X-API-Key' => env('RUNVOUCH_KEY')])->post("https://api.runvouch.com/v1/runs/start", ['agent' => 'nightly-report', 'source' => 'laravel']);
# rv agent nightly-report --cadence 24h --grace 30m --evidencerv fails open: if RunVouch is unreachable the job still runs and you get one warning line.
Register the cadence and caps
rv agent nightly-report --cadence 24h --grace 30m --max-runtime 1h --evidence --cap-run-cost 2
Register the agent once, from anywhere with the key. Cadence is what turns a schedule that stopped into an alert; --evidence makes a run without evidence a failure; the caps pause the agent when it overspends.
What goes silent on Laravel task scheduler
- No
schedule:runcron line (new server, container without cron, a Forge server whose scheduler was removed): no task runs, no task fails. MISSED is the first and only signal. emailOutputOnFailure()andpingOnFailure()exist per task and fire on a non-zero exit; a command that returns 0 with an empty report is a success to both.withoutOverlapping()holds a lock for 24 hours by default; a task that crashed hard leaves the lock and the next runs are skipped. That is a MISSED with a cause you can read on the dashboard.onOneServer()needs a shared cache; with a file cache each server runs the task, and the daily cap counts every run.
What Laravel task scheduler does not tell you
Laravel's scheduler can e-mail a task's output, ping a URL before, after and on failure, and send events to a monitoring service, all per task and all only when the task ran. The scheduler has no record of a minute in which schedule:run was not called, and the documented crontab line sends its output to /dev/null. Laravel Pulse and Horizon show queues and requests, not whether a scheduled task was skipped.
What RunVouch detects
| Alert | What it means here |
|---|---|
| MISSED | cadence plus grace passed and no run started |
| FAILED | non-zero exit or a reported failure, with the stderr excerpt |
| NO_EVIDENCE | the run said ok but the file, URL or assertion you required is missing |
| STALLED | a run started and never ended within max runtime |
| RETRY_STORM | the same tool called with identical input many times in one run |
| BUDGET_RUN / BUDGET_DAY | cost cap crossed; the agent is paused until you resume it |
| DRIFT | duration or output size far off its 7-run baseline |
Set up in two minutes
- Get a free key (3 agents, no card) and store it where this page says.
- wrap the job: copy the snippet above into the scheduled job.
- Register the cadence once:
rv agent nightly-report --cadence 24h --grace 30m --evidence, or let the first run create the agent and set the cadence on the dashboard. - Send one test alert:
curl -X POST https://api.runvouch.com/v1/settings/test-alert -H "X-API-Key: $RUNVOUCH_KEY". The next missed, failed or empty run reaches the same channels.
Need a key? Get a free key · Stuck? contact