Skip to content

Monitoring glossary

What is heartbeat monitoring?

A heartbeat monitor waits for your job to check in. If the check-in does not arrive on time, it alerts. It is the simplest way to catch work that silently stops.

3 min read9 sectionsUpdated

On this page

Key points

  • Normal checks pull (the monitor calls you); heartbeats push (your job calls the monitor).
  • They catch silence: jobs that never started, hung, or died without logging.
  • Each job gets its own unique ping URL and an expected schedule plus a grace period.
  • Ping only on success, so a job that runs but fails also triggers the alert.

Why heartbeats exist

An uptime check can tell you that your website answers. It cannot tell you that last night's database backup did not run, that the invoice job has been stuck since Tuesday, or that the queue worker crashed and nobody restarted it. These failures are silent: nothing errors, nothing logs, work just stops happening. The first sign is often a customer asking where their invoice is.

A heartbeat monitor, sometimes called a dead man's switch, flips the direction. The job sends a small HTTP request to a unique URL each time it finishes. The monitor knows when to expect it; if the deadline passes without a ping, it raises an alert.

How to add one

Add a single request at the end of the job, only on success:

bash
# crontab: nightly backup at 02:00, then ping on success only
0 2 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 "$VITALRIX_HEARTBEAT_URL" > /dev/null
invoices.pypython
import os, urllib.request

def main():
    run_invoices()  # raises on failure, so the ping below never happens
    urllib.request.urlopen(os.environ["VITALRIX_HEARTBEAT_URL"], timeout=10)

if __name__ == "__main__":
    main()

Choosing the schedule and grace period

JobRunsTypical durationGrace period
Database backupDaily at 02:0020 minutes1 hour
Invoice generationHourly3 minutes15 minutes
Queue worker livenessPings every minuten/a5 minutes
Weekly reportMonday 06:0010 minutes2 hours

Tips

  • One heartbeat per job, not one for the whole server, so the alert names what broke.
  • Use curl -f and a timeout so a hung network call does not hang the job.
  • Do not ping at the start only: a job that starts and then crashes would look healthy.
  • Watch duration too for jobs that matter: a backup that suddenly takes four hours is a warning sign.

VitalRix heartbeat monitors give each job a unique ping URL; if the job does not check in within its deadline, the monitor fires and alerts through your normal channels. See the full cron job monitoring guide.

Frequently asked questions

What is the difference between heartbeat and uptime monitoring?

Uptime monitoring calls your service on a schedule and checks the answer. Heartbeat monitoring waits for your job to call it. Use uptime for things that serve requests, heartbeats for things that run in the background.

Can a heartbeat monitor long-running workers?

Yes. Have the worker ping every minute from its main loop, with a grace period of a few minutes. If the loop hangs or the process dies, the pings stop.

What if the monitoring service itself is down?

A missed ping is evaluated on the monitoring side, so if your job cannot reach it, you get an alert rather than silence, which is the safe failure mode.

Check it now, free

  • A Healthchecks.io alternative: VitalRix vs Healthchecks.io: VitalRix vs Healthchecks.io: cron and heartbeat monitoring compared, plus the uptime checks, status pages, on-call and APM VitalRix adds around them.
  • A Cronitor alternative: VitalRix vs Cronitor: VitalRix vs Cronitor: cron job and heartbeat monitoring, uptime checks, status pages and alerts compared, plus APM and on-call, and when each fits better.
  • How to monitor Render: How to monitor apps on Render: web service uptime and health checks, background workers, cron jobs with heartbeats, managed Postgres and Redis, and alerts.
  • What is URL monitoring?: URL monitoring explained: scheduled checks of a URL for status code, content, response time, redirects and SSL, with sensible settings.
  • What is uptime monitoring?: Uptime monitoring explained: how website and API checks work, what 99.9% uptime means, check intervals, avoiding false alarms, status pages and an example.
  • How to monitor Fly.io: How to monitor apps on Fly.io: multi-region uptime checks, machine health, the built-in Prometheus metrics, Postgres clusters, OpenTelemetry traces and alerts.

Watch your own site and services with VitalRix

Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.