How does heartbeat monitoring work?

On this page

Heartbeat monitoring turns the usual direction round: your job calls the monitor. Each run requests a URL, the monitor compares the arrival times with an expected schedule, and it alerts when a ping is late, reports a failure, or a started run never finishes.

What does a check know?

  • The ping URL, which is its identity and its only credential.
  • The expected schedule: a period such as "every 24 hours", or a cron expression with a time zone.
  • The grace time: how long a ping may be late before an alert goes out.
  • The channels that receive alerts: email, webhooks, Slack, Discord, Telegram and ntfy.

Which states can a check be in?

StateMeaning
newNo ping has arrived yet. A new check does not alert unless you turn on a first-ping deadline.
upThe last ping arrived on time.
lateThe expected ping has not arrived, but the grace time is not over. No alert yet.
downThe grace time passed with no ping, or the job reported a failure. One alert goes out.
pausedMonitoring is off. A ping can bring the check back, unless you chose to stay paused.

Which signals can a job send?

URLMeaning
/<uuid>The job finished successfully.
/<uuid>/startThe job started; if no finish follows within the grace, the check goes down.
/<uuid>/failThe job failed; the check goes down at once.
/<uuid>/<0-255>The job finished with this exit status; 0 is success and anything else is a failure.
/<uuid>/logRecord an event and a body without changing the state.

A POST body of up to 100,000 bytes is kept with the ping, which is where error output belongs. Details are in the pinging API docs.

Why add a grace time?

Real jobs vary. A backup that takes 8 minutes most nights takes 14 after a big change. A grace time absorbs normal variation and keeps alerts meaningful. Choosing a grace time has a rule and worked examples.

Questions and answers

How often can a job ping?
Up to five recorded pings a minute per check. Beyond that, extra requests are answered but not recorded.
Does heartbeat monitoring need an agent on the server?
No. Anything that can make an HTTPS request can ping: curl, wget, a language's HTTP library, a scheduler's webhook step.
Know the moment a job goes quiet

Create a check, add one curl to the job, and CronMissed alerts you when a ping is late or reports a failure.

Start monitoring