Heartbeats catch the jobs that fail silently: backups, cron jobs, queue workers and scheduled reports. Your job pings a secret URL when it runs. If the ping doesn't arrive on time, Alertly.Net alerts you.
Create a heartbeat
Open Heartbeats, choose Add heartbeat, and set:
- Schedule: a Simple interval, from every minute to once a week, or a Cron expression like
0 3 * * *with its Time zone (shortcuts like@dailywork too). - Grace time: how late a ping may be before it counts as missed, from 1 minute to 6 hours. Leave room for slow runs. Jobs that send a start ping also get this long to finish.
A new heartbeat shows Awaiting first ping. Alerts start after its first check-in.
You'll get a unique ping URL like:
https://alertly.net/api/ping/your-heartbeat-token
Treat it like a password. Anyone with the URL can send pings. Each URL accepts up to 30 pings a minute.
Ping from your job
Add one line at the end of the job, so it only pings when everything before it succeeded:
# crontab
0 3 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 https://alertly.net/api/ping/your-heartbeat-token
Any GET or POST works. If you send a request body (up to 1,000 characters), it's stored with the ping. That's useful for a short summary like "backed up 12 GB".
Report start and failure
Measure how long jobs take and catch failures straight away:
URL=https://alertly.net/api/ping/your-heartbeat-token
curl -fsS -m 10 "$URL/start"
if /usr/local/bin/backup.sh; then
curl -fsS -m 10 "$URL"
else
curl -fsS -m 10 --data "exit code $?" "$URL/fail"
fi
/startmarks the beginning of a run, so the heartbeat page shows its duration./failraises a Heartbeat failed alert immediately, without waiting for the grace time.
Examples
Laravel scheduler
Schedule::command('backup:run')->daily()
->pingBefore('https://alertly.net/api/ping/your-heartbeat-token/start')
->pingOnSuccess('https://alertly.net/api/ping/your-heartbeat-token')
->pingOnFailure('https://alertly.net/api/ping/your-heartbeat-token/fail');
Node.js
await fetch('https://alertly.net/api/ping/your-heartbeat-token');
Python
import urllib.request
urllib.request.urlopen("https://alertly.net/api/ping/your-heartbeat-token", timeout=10)
Pausing
Pause a heartbeat while a job is intentionally switched off. Pings are still recorded, but no alerts are sent, and open alerts close quietly. After Resume, the heartbeat waits for the next ping before it can alert again.