Heartbeat monitoring is a method of checking that a process is still running by waiting for it to send periodic signals.
Instead of the monitor reaching out to the process, the process reaches out to the monitor. If the signal stops arriving, the process is assumed to have failed.
The name comes from the medical analogy. A heartbeat means the patient is alive. No heartbeat means trouble. In software, the "patient" is a cron job, background worker, batch script, or any process that runs on a schedule.
How heartbeat monitoring works#
You configure a monitor with an expected interval: "this job should ping every 10 minutes." The job runs, finishes its work, and sends an HTTP GET or POST to a unique URL. The monitoring service records the ping and resets its timer. If the next ping doesn't arrive before the timer expires (plus a configurable grace period for differences between the job's clock and the monitor's clock, or slow runs), the service triggers an alert.
This inverted model catches failures that active polling can't. A web server that crashes returns connection errors, and an uptime monitor spots that immediately. But a cron job that stops running produces no signal at all. There's nothing to poll. This approach detects the absence of a signal, which makes it the standard method for anything that runs on a schedule and fails silently.
Heartbeat monitoring vs. uptime monitoring#
Uptime monitoring checks whether an endpoint is responding. Heartbeat monitoring checks whether a process finished on time. They solve different problems. A web server needs uptime checks. A nightly database backup needs a heartbeat. Some systems need both.
The key difference is directionality. Uptime monitoring is pull-based: the monitor pings your server. Heartbeat monitoring is push-based: your process pings the monitor. That push model is why it works for processes behind firewalls, inside containers, or on machines with no inbound network access. It's not to be confused with a health check, which tests endpoint availability from the outside.
Other names for heartbeat monitoring#
The concept goes by several names depending on the vendor. Dead man's switch (or dead man's snitch) is the most common alternative. Some services call it cron monitoring, ping monitoring, or check-in monitoring. The mechanism is identical: expect a signal, alert on its absence.
How WatchCron implements it#
WatchCron's cron job monitoring uses the heartbeat model. Add a curl call to the end of your script, set the expected interval and grace period, and missed pings trigger alerts through your configured notification channels.