What Is Heartbeat Monitoring?
Heartbeat monitoring is a method of detecting when scheduled jobs stop running. Your job sends a “heartbeat” — an HTTP request to a monitoring URL — after each successful run. If the monitoring service doesn't receive a heartbeat within the expected interval, it sends you an alert.
Unlike uptime monitoring (which checks if a service is reachable), heartbeat monitoring works in the opposite direction. Your server talks to the monitoring service, not the other way around. This makes it the right tool for cron jobs, background workers, data pipelines, and any process that runs on a schedule.
The concept is sometimes called “dead man's switch monitoring” or “cron monitoring.” The idea is the same: silence means something is wrong.
How heartbeat monitoring works
# Normal operation (everything is fine)
┌─────────────┐ HTTP GET /ping/abc123 ┌──────────────┐
│ Your Cron │ ─────────────────────────▶ │ CronSafe │
│ Job │ (sent after each run) │ (watches) │
└─────────────┘ └──────────────┘
✓ runs ✓ ping arrives ✓ all green
# Failure (job crashes, hangs, or never starts)
┌─────────────┐ ┌──────────────┐
│ Your Cron │ ✗ no ping │ CronSafe │
│ Job │ │ (watches) │
└─────────────┘ └──────────────┘
✗ silent ✗ ping missing │
▼
┌──────────────┐
│ Alert sent │
│ (Slack, etc)│
└──────────────┘
- Create a monitor with an expected interval (e.g. “every hour”) and a grace period (e.g. “5 minutes late is OK”)
- Add a ping to the end of your job — a single HTTP request to a unique URL
- The service watches for incoming pings. If a ping arrives on time, everything is green
- If a ping is missing past the interval + grace period, the service sends an alert via email, Slack, Discord, Telegram, or webhook
Heartbeat monitoring vs uptime monitoring
| Heartbeat monitoring | Uptime monitoring | |
|---|---|---|
| Direction | Your server → Monitor | Monitor → Your server |
| Best for | Cron jobs, workers, pipelines | Websites, APIs, services |
| Detects | Silent failures, non-runs | Downtime, slow responses |
| Requires | One curl per job | Public endpoint |
Common use cases
- Database backups — know immediately when your nightly backup fails or doesn't start
- Data pipelines — ETL jobs, report generation, data syncs that run on a schedule
- Certificate renewal — certbot or ACME jobs that renew SSL certificates
- Cleanup scripts — log rotation, temp file purging, old session cleanup
- Background workers — queue processors, email senders, webhook dispatchers
- CI/CD pipelines — scheduled GitHub Actions, nightly builds, deployment checks
Code example
Adding heartbeat monitoring to a cron job takes one line:
# crontab -e # Run backup at 2 AM, ping CronSafe on success 0 2 * * * /usr/local/bin/backup.sh && curl -s https://api.getcronsafe.com/ping/abc123
The && ensures the ping only fires if the job exits successfully. If backup.sh fails, hangs, or never runs, the ping is missing and you get alerted.
FAQ
What is the difference between heartbeat monitoring and uptime monitoring?
Uptime monitoring sends requests TO your server to check if it's reachable. Heartbeat monitoring receives requests FROM your server to confirm a job ran. Use uptime monitoring for websites and APIs. Use heartbeat monitoring for cron jobs and background tasks.
Is heartbeat monitoring free?
Several services offer free tiers. CronSafe provides 20 free monitors with no time limit — see pricing. Healthchecks.io also offers 20 free monitors. Cronitor offers 1 free monitor.
Does heartbeat monitoring slow down my cron jobs?
No. The ping is a single HTTP GET request that takes milliseconds. CronSafe responds in under 2ms. The curl call adds negligible overhead to your job's total runtime.
Try heartbeat monitoring free with CronSafe
20 monitors, no credit card, no expiration. Your first monitor in 30 seconds.
Start free monitoring →