Heartbeats
The SDK can ping a heartbeat on the Quiet Guard server every time one of your scheduled tasks runs. The server works as a dead-man's switch: once the heartbeat is armed with an expected period, missing pings trigger an overdue alert. A crashed cron entry, a forgotten schedule:run, a task disabled "temporarily": silence itself becomes the alert. The full concept (statuses, arming, alert channels) is covered in the server documentation.
The scheduler macro (preferred)
The SDK registers a monitorHeartbeat() macro on Laravel's scheduled events. Chain it directly on the task you want to watch, in routes/console.php:
Two properties make the macro the recommended wiring:
- It pings only when the task succeeds (it hooks the scheduler's
onSuccess). A task that crashes or exits non-zero sends nothing, stays silent, and therefore triggers the overdue alert. Pinging before the task, or unconditionally after it, would defeat the whole point. - It honours the SDK's gates at run time: when
MONITOR_ENABLED=false, or when the current environment is not in theMONITOR_ENVIRONMENTSallowlist, the ping is skipped. A staging scheduler running the same code therefore never pings your production heartbeats. See Configuration.
Manual ping
You can also ping from any code path with the Artisan command, for example from a raw cron line after a shell script:
When MONITOR_ENABLED=false, the command prints a warning and sends nothing. It exits with a failure code when the ping cannot be delivered (check MONITOR_URL / MONITOR_KEY).
Lifecycle
- The first ping auto-registers the heartbeat on your project, unarmed: pings are recorded, nothing ever alerts. You wire the ping first, then decide what "late" means.
- Arming happens in the dashboard: open the project's Heartbeats tab and set the expected period (plus a grace margin). The SDK does not expose arming; it only pings.
- Recovery is silent: after an outage, the next successful ping returns the heartbeat to healthy without a notification.
Slug rules
A heartbeat slug identifies the task: lowercase letters, digits and single dashes (reports-send, nightly-backup). The server normalises anything else, so use that charset from the start and keep the slug identical between the macro and the dashboard.
Next step
Continue with Encrypted backups, the natural companion: a heartbeat on your backup task tells you the day it stops running.
You are reading the Laravel SDK v1.0 documentation.