Heartbeat Monitoring vs Uptime Monitoring
Uptime monitoring probes your URLs from the outside. Heartbeat monitoring listens for a ping from your job. Learn when each model fits and why they are complementary.
Uptime monitoring and heartbeat monitoring solve different problems — one probes your infrastructure from the outside, the other waits for your system to check in. Understanding the distinction determines whether a silent failure ever reaches your on-call queue.
Two Fundamentally Different Models
Uptime Monitoring: Pull-Based
Uptime monitoring (also called synthetic monitoring or external monitoring) works on a pull model. An external agent periodically sends an HTTP request to a URL you configure and expects a 2xx response within a timeout window. If the server is down, returns a 5xx, or times out, an alert fires. The monitor is the actor — it reaches out to your system.
This model is well suited to anything that is permanently reachable: web servers, APIs, login pages, checkout flows. The question it answers is: is this endpoint responding correctly right now?
Heartbeat Monitoring: Push-Based
Heartbeat monitoring (also called dead-man's-switch monitoring) inverts the relationship entirely. Instead of the monitor reaching out to your system, your system reaches out to the monitor. A job, script, or process pings a dedicated URL after it completes successfully. The monitor tracks the cadence of those pings; if the expected ping does not arrive within the configured period plus a grace window, an alert fires.
The alarm is triggered by the absence of a signal, not by the presence of an error. That inversion is the defining characteristic of the dead-man's-switch pattern.
With CronJobPro heartbeat monitoring, your job sends a GET or POST request to https://cronjobpro.com/ping/<token> on success. You can also call /ping/<token>/fail to report an explicit failure, or /ping/<token>/exitcode/<n> to report a numeric exit code. If the success ping does not arrive before the period plus grace time elapses, your configured alert channels fire.
The Core Inversion Concept
Consider a cron job that runs every hour to generate invoices. An uptime monitor pointed at your web server will confirm the server is up all day — but it has no visibility into whether the invoice job ran at 03:00, whether it completed, whether it errored silently, or whether the cron daemon was restarted and the schedule was lost. The job is a transient process, not a persistent endpoint.
A heartbeat monitor covers exactly this gap. The job is instrumented with a single HTTP call at the end of its success path. The monitor now knows three things: the job ran, it reached the end of the success path, and it did so within the expected window. Remove any one of those conditions and an alert fires.
What Each Model Catches — and Misses
| Scenario | Uptime Monitor | Heartbeat Monitor |
|---|---|---|
| Web server returns 500 | Catches it | Not applicable |
| API endpoint times out | Catches it | Not applicable |
| Cron job never starts (scheduler down) | Misses it | Catches it |
| Cron job starts but exits with error | Misses it | Catches it (no success ping sent) |
| Cron job hangs indefinitely | Misses it | Catches it (ping never arrives) |
| Cron job completes but produces wrong output | Misses it | Misses it (logic error, not a signal problem) |
| Server is reachable but background worker crashed | Misses it | Catches it (worker cannot ping) |
| DNS or TLS certificate failure on public endpoint | Catches it | Not applicable |
Neither model catches application-level correctness errors — if a job runs, completes, and pings successfully but produces incorrect data, only application-level assertions or output validation will catch that. Both models operate at the infrastructure and execution layer.
Why Cron and Batch Jobs Cannot Be Covered by Uptime Checks
An uptime check requires a persistent, addressable endpoint. A cron job has neither property. It starts, runs, and exits — there is no socket listening for incoming connections before or after it runs. Even if you expose a status endpoint that reflects the last run time, an uptime check would still only confirm that the web server serving that endpoint is up; it would not confirm that the underlying job ran on schedule.
The same applies to batch processing pipelines, database maintenance scripts, backup jobs, report generators, and any other periodic background task. These workloads are the native territory of heartbeat monitoring.
# Minimal bash instrumentation: ping on success, /fail on error
set -e
run_backup.sh
# Job succeeded — send heartbeat
curl -fsS --retry 3 https://cronjobpro.com/ping/YOUR_TOKEN
# If run_backup.sh exits non-zero, set -e aborts here
# Optionally catch and report failure explicitly:
# run_backup.sh || curl -fsS https://cronjobpro.com/ping/YOUR_TOKEN/failWhen to Use Each
Use uptime monitoring when
- You have a publicly or internally reachable HTTP endpoint that must be continuously available.
- You want to detect outages, slow responses, or certificate expiry on web properties.
- You are running synthetic checks against a login flow, API health route, or critical user path.
- You need to publish availability data to a public or internal status page.
Use heartbeat monitoring when
- You run scheduled jobs — cron, task schedulers, CI pipelines, ETL processes — that must complete on time.
- You need to know that a background worker is alive and processing, not just that its host server is up.
- You want to detect missed runs, hangs, or silent failures in jobs that have no public endpoint.
- You run jobs on infrastructure you do not control (third-party servers, edge devices, developer machines) and need central visibility.
Why They Are Complementary, Not Competing
A production system typically has both persistent services and periodic jobs. An e-commerce platform might have an API server (covered by uptime monitoring), a nightly order-reconciliation job (covered by heartbeat monitoring), a payment webhook handler (uptime), and a weekly fraud-report generator (heartbeat). Choosing one model over the other leaves a category of failure invisible.
In practice, mature monitoring stacks layer the two models. Uptime checks confirm your customer-facing surface is reachable; heartbeat checks confirm your back-office automation is executing on schedule. Together they give full coverage of both the reactive (is it up?) and the proactive (did it run?) questions.
If you use CronJobPro to run HTTP cron jobs (scheduled outbound requests), each executed job already has a success/failure record — no manual instrumentation needed. For jobs you run on your own servers or pipelines, add a single ping call and configure a heartbeat monitor to close the visibility gap.
Setting Up Both in Practice
- 1
Audit your workloads
List every scheduled task, background worker, and batch process alongside every public or internal HTTP endpoint. Assign each to the pull or push category.
- 2
Configure uptime checks for endpoints
Point uptime monitors at your health routes, login pages, and critical API paths. Set check intervals and alert thresholds appropriate to your SLA.
- 3
Instrument periodic jobs with heartbeat pings
Add a single HTTP call to the success path of each cron job or batch script. Use /ping/<token>/fail or /ping/<token>/exitcode/<n> to report failures explicitly where your job can catch them.
- 4
Set period and grace time accurately
The period should match your job's schedule. The grace time should cover the maximum expected runtime plus reasonable scheduling jitter — but not so long that a missed run goes undetected for hours.
- 5
Route alerts to the right channels
Wire both uptime and heartbeat alerts to your preferred channels (email, Slack, PagerDuty, Opsgenie, webhook). Consider routing heartbeat alerts for critical batch jobs to the same on-call rotation as your API alerts.
Quick Reference
| Property | Uptime Monitoring | Heartbeat Monitoring |
|---|---|---|
| Direction | Pull (monitor probes you) | Push (you ping the monitor) |
| Alert trigger | Presence of a bad response | Absence of an expected ping |
| Requires persistent endpoint | Yes | No |
| Covers cron/batch jobs | No | Yes |
| Covers web servers and APIs | Yes | Indirectly (if the server sends pings) |
| Detects scheduler failure | No | Yes |
| Detects silent job hangs | No | Yes |
| Instrumentation required | None (URL only) | One HTTP call in your job |
Both models are available in CronJobPro. You can explore heartbeat setup at the heartbeat monitoring guide, review alert channel options, or use the cron expression tool to verify your schedule before instrumenting your jobs.
Set up your first heartbeat monitor →