Getting Started / How Monitoring Works
How Monitoring Works
At its core, HealthyCron uses a "heartbeat" or "dead man's switch" model. It expects an incoming HTTP request at regular intervals.
The Heartbeat Model
When your cron job or scheduled task completes successfully, it makes a simple HTTP GET or POST request to HealthyCron. This ping tells HealthyCron that everything is functioning correctly for that interval.
Job runs ↓ Pings /ping/uuid ↓ healthycron resets timer
Failure Modes
There are primarily two reasons why a job might fail, and both are caught by this model:
- The job never started. The server crashed, the cron daemon stopped, or the physical server lost power. Because the job never ran, the ping never triggered, and HealthyCron alerts you that it missed its schedule.
- The job started but crashed. An exception was thrown, or the script exited gracefully due to an error. Because it exited before reaching the ping at the end of the script, HealthyCron realizes the pulse is missing and alerts you.
Start, Success, and Fail States
For advanced tracking, you can emit telemetry at different stages of your job's lifecycle. By pinging at the start, you allow HealthyCron to measure exact execution duration.
| Endpoint | When to call it | Example |
|---|---|---|
| /start | At the very beginning of the job execution. This does not complete the check, but marks it as executing. | curl .../ping/{uuid}/start |
| (base url) | At the very end of the script, indicating that it ran entirely and succeeded. | curl .../ping/{uuid} |
| /fail | Inside your exception handler or catch block when you know the job has failed, triggering an immediate alert regardless of remaining grace period. | curl .../ping/{uuid}/fail |
Previous
← Quick Start
Next
Monitors →