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
/failor 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 field | Default | Limits and notes |
|---|---|---|
| name | Empty | Required. Up to 200 characters, on one line. |
| on failure — notify | None (all team channels) | Pick channels to limit who is alerted. Shown only when your team has channels. |
| cron expression — leave empty for an interval | Empty | A standard 5-field crontab line, such as 15 2 * * *. |
| expected every (no cron) | 1 minute | Minutes or hours. Your plan's minimum interval still applies. |
| grace periods (no cron) | 2 | 1 to 100. |
| timezone (cron) | Empty (UTC) | For example Asia/Kolkata. |
| grace seconds (cron) | Empty | How 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:
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,
CreateHeartbeatMonitorreturns thetokenfor the ping URL.gracePeriodsis up to 1,000; 0 or none is stored as 1.graceSecondsis up to 2,592,000 (30 days).