Heartbeat monitoring for cron jobs
Cron jobs fail without making a sound. Heartbeat monitors tell you when a job did not run, ran late or never finished.

Cron jobs are the quietest part of most systems. Backups, billing runs, report emails and cleanup tasks run on a schedule, and when they stop, nothing errors. Nobody notices until a customer asks why their invoice never arrived. Heartbeat monitoring fixes that.
1. How a heartbeat works
A heartbeat monitor turns the usual check around. Instead of Navy calling your service, your job calls Navy. Each heartbeat monitor has a unique URL, and your job sends a request to it every time it runs.
2. Set the expected schedule
Tell Navy how often the job should run, like every hour or every day at 02:00 UTC. If a ping does not arrive on time, Navy treats the job as missed and opens an incident. You can use cron syntax directly.
3. Add a grace period
Jobs do not always run to the second. A grace period gives a job a little extra time before it counts as late. A nightly backup might get 15 minutes. A job that runs every minute might get 30 seconds.
4. Track start and finish
Send one ping when the job starts and another when it finishes. Navy then knows the job is running, how long it took and whether it got stuck. A job that started and never finished is often worse than one that never ran.
5. Report failures explicitly
If your job catches an error, send a failure ping instead of waiting for the schedule to run out. Navy alerts right away and records the failure on the monitor. You find out in seconds instead of at the next expected run.
6. Keep it to one line
Adding a heartbeat should not need a library. A single curl call at the end of a script is enough. For jobs that run in containers or serverless functions, the same HTTP request works from anywhere.
7. Route alerts like any other monitor
Heartbeat monitors use the same alert channels and escalation policies as your HTTP and TCP monitors. A missed billing run can page on-call, while a late cleanup job can post to Slack.
| Job | Schedule | Grace period |
|---|---|---|
| Database backup | Daily at 02:00 UTC | 15 min |
| Invoice run | Hourly | 5 min |
| Queue cleanup | Every minute | 30s |
If a job matters enough to schedule, it matters enough to monitor. Add a heartbeat to every cron job you would be unhappy to find broken a week later.


