What is a Heartbeat Monitor and When Do You Need One
Regular monitoring has a blind spot
Traditional uptime monitoring works by pinging your service from the outside. A monitoring tool sends an HTTP request to your URL, and if it gets a healthy response, everything's fine.
This works great for web servers, APIs, and anything with a public URL. But a lot of critical software doesn't have a URL:
- Cron jobs that run on a schedule
- Background workers processing queues
- Nightly database backups
- Scheduled data imports and exports
- Batch email senders
- Report generators
These processes run inside your infrastructure. There's nothing to ping from the outside. So how do you know when they stop working?
Heartbeat monitoring flips the direction
Instead of the monitor pinging your service, your service pings the monitor.
Think of it like a check-in system. You tell the monitor: "I'm going to check in every hour." If an hour passes without a check-in, something is wrong.
That's it. That's the whole concept.
The name comes from the analogy: a heartbeat is a regular signal that says "I'm alive." When the signal stops, you investigate.
How it works in practice
-
You create a heartbeat monitor with an expected interval (how often your job runs) and a grace period (buffer for slow runs or network delays)
-
You add a ping to your job. Usually one line at the end of your script:
curl -sf -X POST "https://getchirp.dev/api/monitors/YOUR_ID/heartbeat?token=YOUR_TOKEN" -
The monitor watches for pings. If it doesn't receive one within the expected window (interval + grace period), it triggers an alert.
-
When the next ping arrives, the monitor automatically recovers and the alert resolves.
When you need one
Short answer: whenever you have a scheduled process where silent failure would cause real problems.
Here's a quick test: if this job stopped running tomorrow and nobody checked for a week, would that be a problem? If yes, you need a heartbeat monitor on it.
Common examples:
Database backups are the scariest one. You think you have backups. You don't find out they stopped until you need to restore. By then it's too late.
Queue processors are another big one. If your background job worker dies, tasks pile up silently. Users stop getting emails, webhooks stop firing, data stops syncing. Nobody notices until the symptoms get bad enough.
Billing and payment jobs - subscription renewals, invoice generation, payment retries. Silent failures here directly cost you money. Data syncs between services (CRM, analytics, external APIs) create drift that gets harder to fix the longer it goes. And cleanup jobs (log rotation, temp files, session pruning) seem unimportant until your disk fills up and things start crashing.
When you probably don't need one
Not everything needs a heartbeat monitor:
- Web servers and APIs - use regular HTTP monitoring instead
- One-off scripts you run manually
- Development/staging processes - unless they affect production data
- Jobs where failure is obvious - like a report someone checks every morning
Grace period: why it matters
Most heartbeat monitors let you set a grace period - extra time after the expected ping before triggering an alert.
This matters because real-world jobs don't run with perfect timing:
- A cron job scheduled for every hour might actually run at :00, :01, :59, :02, depending on server load
- A backup that usually takes 5 minutes might take 20 minutes on a busy night
- Network hiccups can delay the ping even after the job finishes
Set your grace period wide enough to avoid false alarms but tight enough to catch real failures. A good starting point: set it to half your interval. If your job runs every hour, a 30-minute grace period catches real failures without alerting on slow runs.
Setting up heartbeat monitoring with Chirp
Chirp includes heartbeat monitoring on all plans (including free):
- Create a new monitor and select "Heartbeat" type
- Set your expected interval and grace period
- Copy the ping URL and add it to your script
- Optionally link it to a component on your status page
When a heartbeat is missed, Chirp creates an incident, updates your status page, and notifies you. When the next ping arrives, it auto-recovers and generates a summary. Heartbeat monitoring is included on all plans, including free.