Skip to content

2.6Heartbeat

What it checks#

A heartbeat monitor works the other way round. obsrvly does not call your system. Your job calls obsrvly each time it runs, by sending a request to the monitor's ping URL. Chapter 5 covers heartbeats in full.

When it is up, degraded or down#

  • Up: the job pinged on time and reported success.
  • Down: a ping was missed, or the job reported a failure with /fail or a non-zero exit code. An exit code is the number a program returns when it ends; 0 means success.

Configuration#

Heartbeats have no check interval, timeout or locations. The left column says: Inbound — there is no outbound schedule or location.

Dashboard fieldDefaultLimits and notes
nameEmptyRequired. Up to 200 characters, on one line.
on failure — notifyNone (all team channels)Pick channels to limit who is alerted. Shown only when your team has channels.
cron expression — leave empty for an intervalEmptyA standard 5-field crontab line, such as 15 2 * * *.
expected every (no cron)1 minuteMinutes or hours. Your plan's minimum interval still applies.
grace periods (no cron)21 to 100.
timezone (cron)Empty (UTC)For example Asia/Kolkata.
grace seconds (cron)EmptyHow late a run may be. Empty or 0 means 5 minutes. Cannot be negative. Up to 30 days.

Assertions supported#

None.

Example#

The ping URL appears on the monitor page after you create the monitor. Copy it from there. Then call it at the end of your job:

Report success
bash
curl -fsS -X POST "<your ping URL>"

Add /start at the start of a run, /fail on failure, or /<exit code> to send the job's exit code.

Good to know#

  • The send test ping button is always disabled. Heartbeats report on their own.
  • Through the API, CreateHeartbeatMonitor returns the token for the ping URL. gracePeriods is up to 1,000; 0 or none is stored as 1. graceSeconds is up to 2,592,000 (30 days).

Last updated