
Most uptime monitoring works by probing your service from the outside — an external server sends a request and waits for a response. This works well for websites and APIs. But what about background jobs, cron tasks, and worker processes that don't expose an HTTP endpoint?
Heartbeat monitoring (also called dead man's switch monitoring or cron job monitoring) flips the model around: instead of the monitor probing your service, your service pings the monitor on a regular schedule. If the check-in stops arriving, the monitor raises an alert.
Consider a background job that runs every night at midnight to process customer data, send emails, or run database maintenance. Traditional HTTP uptime monitoring can't check this — there's no URL to hit. The only way to detect failure is by its absence: if the job doesn't run, no one knows until downstream problems surface hours or days later.
Without heartbeat monitoring, you discover cron failures when:
Heartbeat monitoring catches these failures immediately, at the next expected check-in interval that gets missed.
The "success ping" is typically a simple HTTP GET or POST request to a URL like:
https://monitoring-service.com/heartbeat/abc123
Your cron job or script makes this request at the end of a successful run. If the job crashes, is skipped, or takes too long, the ping never arrives.
Heartbeat monitoring is suited for any repeating task that must run on a schedule:
Database tasks:
Application tasks:
Infrastructure tasks:
Data pipelines:
If any of these stop running and no one notices for days, heartbeat monitoring fills that gap.
| Heartbeat Monitoring | HTTP Uptime Monitoring | |
|---|---|---|
| Direction | Service → Monitor | Monitor → Service |
| Best for | Cron jobs, workers, pipelines | Websites, APIs, HTTP endpoints |
| Detects | Job didn't run / crashed | Server down / returning errors |
| Requires | Code change to add ping | Just a URL |
| Failure mode | Missed check-in | Failed HTTP response |
Both types are complementary. A complete monitoring setup includes uptime monitoring for your public-facing endpoints and heartbeat monitoring for your background processes.
In your monitoring tool, create a new heartbeat (or "cron job") monitor and specify:
You'll receive a unique ping URL for this monitor.
At the end of your cron job or background task, add a call to the ping URL:
Shell script:
# Your job logic here
./run_backup.sh && curl -s "https://your-monitor/heartbeat/abc123"
Python:
import requests
# Your job logic here
run_backup()
requests.get("https://your-monitor/heartbeat/abc123")
Node.js:
// Your job logic here
await runBackup();
await fetch("https://your-monitor/heartbeat/abc123");
The key pattern is: only ping if the job succeeded. If run_backup.sh fails, the && prevents the ping, which correctly triggers a missed heartbeat alert.
Set up alerts to fire when a heartbeat is missed — the same channels you use for your uptime alerts: email, SMS, Slack.
Domain Monitor includes cron job / heartbeat monitoring as part of its monitoring suite. See introducing cron monitoring for how it works in practice.
The grace period is important. Cron jobs occasionally run slightly late due to system load — a job scheduled at midnight might not start until 12:02am. Setting a grace period of 15-30 minutes prevents false alarms from these minor delays while still catching genuine failures.
Set your grace period based on your job's typical variance:
AI agent workflows often involve scheduled tasks — automated agents that run at specific intervals to process data, check for updates, or trigger actions. Heartbeat monitoring is ideal for these workflows:
This gives you visibility into whether your AI automation is actually running on schedule, not just whether the underlying server is up.
Background jobs fail silently more often than any other class of software. There's no user seeing an error, no server returning a 500, no alert from your hosting provider. The only evidence is an absence — something that should have happened, didn't.
Heartbeat monitoring converts this absence into a signal. It's the difference between discovering a three-week backup failure when you need to restore data, and getting an alert on night one.
Add heartbeat monitoring for your cron jobs at Domain Monitor.
Generative AI creates new content — text, images, code, and more. This guide explains how it works, what tools are available, and where it's genuinely useful versus overhyped.
Read moreCursor AI is an AI-powered code editor built on VS Code. Learn what it does, how it works, and whether it's the right tool for your development workflow.
Read moreClaude Opus is Anthropic's most capable AI model, built for complex reasoning and demanding tasks. Learn what it does, how it compares, and when to use it.
Read moreLooking to monitor your website and domains? Join our platform and start today.