Heartbeat (Cron Job) Monitors

What a Heartbeat Monitor Is

A Heartbeat monitor is a passive dead man's switch for work that is supposed to run on a schedule — cron jobs, nightly backups, ETL pipelines, queue workers, and similar background tasks. Instead of LoadFocus calling your service, your job calls LoadFocus every time it finishes successfully. If the expected ping doesn't arrive in time, the monitor goes DOWN and alerts fire.

Unlike active checks, a Heartbeat monitor does not probe anything and has no regions — it simply waits for your job to report in. That makes it ideal for verifying that scheduled work actually ran, not just that an endpoint is reachable.

How It Works

  1. You create a Heartbeat monitor and set an expected ping interval and a grace period.
  2. LoadFocus gives you a unique ping URL.
  3. Your job pings that URL on each successful run.
  4. If a ping arrives within the expected window, the monitor stays UP.
  5. If no ping arrives within interval + grace period, the monitor goes DOWN and alerts fire.
  6. The next successful ping recovers the monitor back to UP.

All times and intervals are expressed in seconds.

Create a Heartbeat Monitor

  1. Open the New API Check page.
  2. Choose the Heartbeat type.
  3. Set the expected ping interval in seconds — how often your job is supposed to report (for example, 3600 for an hourly job).
  4. Set a grace period in seconds — the extra slack you allow before declaring the job late (for example, 300).
  5. Copy the unique ping URL that LoadFocus generates.
  6. Choose your alert channels and save.

Ping the URL From Your Job

Have your job call the ping URL after it completes successfully. Any of GET, POST, or HEAD works.

The simplest way is to append a curl call to the end of your script or cron entry:

curl -fsS https://apimonitor.loadfocus.com/heartbeat/<your-ping-id>

The -f flag makes curl fail on HTTP errors, -s keeps it quiet, and -S still surfaces real errors. Run this only on success — for example, as the last line of the job — so a failed run does not ping and the monitor correctly catches the miss.

Alerts and Recovery

  • When interval + grace elapses with no ping, the monitor flips to DOWN and your alert channels are notified.
  • When the next ping arrives, the monitor recovers to UP and a recovery notification is sent.

This gives you fast, reliable confirmation that your scheduled work is genuinely running — and a clear alert the moment it silently stops.

For active, region-based checks instead, see How to Create a New API Check.