Search by

hellocron / laravel

hellocron

HelloCron monitoring for the Laravel Scheduler: automatic run/complete/fail pings for every scheduled task, plus monitor sync via the Management API.

v0.2.0 2026-09-11 19:26 UTC

This package is auto-updated.

Last update: 2026-09-11 19:33:48 UTC


README

Monitoring for the Laravel Scheduler. Install the package, set one API key, and every scheduled task reports run / complete / fail to HelloCron, with duration and exit code. When a task stops running, the silence itself raises the alert (a dead man's switch), which is the failure mode schedule:run logs can never show you.

Installation

composer require hellocron/laravel

Add your ingest key (from the HelloCron panel, starts with ck_) to .env:

HELLOCRON_INGEST_KEY=ck_your_key

That is all. The next schedule:run starts pinging. Monitors are created automatically on first ping, subject to your plan's monitor limit.

What gets reported

For every task the Scheduler executes:

  • run when the task starts, complete when it finishes, fail on a non-zero exit code or an exception (with the message), skip when a filter such as withoutOverlapping prevents the run
  • duration in seconds, exit code, hostname
  • a series id correlating each run's start and end, so overlapping runs of the same task never pair up wrong

Monitor names are derived from the command (laravel-<app hash>-inspire), so several apps on one account stay apart. Override the prefix with HELLOCRON_PREFIX or in the published config.

Monitor sync (optional)

Pings alone create monitors with default settings. To set expected intervals and grace periods computed from each task's actual cron expression, add a Management API key (mk_, scopes read + write) and run:

HELLOCRON_MANAGEMENT_KEY=mk_your_key php artisan hellocron:sync --dry-run
php artisan hellocron:sync

The command creates missing monitors, updates existing ones, and reports monitors that no longer match any scheduled task. It never deletes anything. Run it after deployments that change the schedule.

Configuration

php artisan vendor:publish --tag=hellocron-config
Key Env Default
enabled HELLOCRON_ENABLED true
ingest_key HELLOCRON_INGEST_KEY none (package inert without it)
management_key HELLOCRON_MANAGEMENT_KEY none (only hellocron:sync needs it)
prefix HELLOCRON_PREFIX laravel-<md5(app.url)[0:8]>-
tags - [] (sync always adds laravel and the hostname)

Safety

Monitoring must never take your app down. Pings use a 1 second connect and 2 second request timeout, and every failure is swallowed: if the monitoring endpoint is unreachable, your tasks run exactly as before. The Management API is only ever called from the hellocron:sync console command, never while your schedule executes.

Requirements

  • PHP 8.1+
  • Laravel 10, 11 or 12

Links

License

MIT