Config fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
config.expectedInterval | integer | Yes | — | Expected time between pings in seconds (1–86,400) |
config.gracePeriod | integer | Yes | — | Extra time to wait before marking as down, in seconds |
The total allowed gap between pings is
expectedInterval + gracePeriod. For a job that runs hourly with a 10-minute grace period, set expectedInterval: 3600 and gracePeriod: 600.Ping URL
When you create a heartbeat monitor, DevHelm generates a uniquepingUrl. The URL is available on the monitor response object. Your service should call this URL (any HTTP method) on each successful run.
Sending payload data
You can include a JSON body with your ping. This is useful for reporting job metadata:heartbeat_payload_contains assertion to validate payload contents.
Assertions
| Assertion | Required fields | Description |
|---|---|---|
heartbeat_received | (none) | Passes if a ping was received within the expected window |
heartbeat_max_interval | maxSeconds | Fails if the actual interval between pings exceeds threshold |
heartbeat_interval_drift | maxDeviationPercent (1–100) | Fails if the interval varies more than the allowed percentage |
heartbeat_payload_contains | path, value | Fails if the ping payload at the given path doesn’t contain the value |
Examples
Cron job (hourly)
With payload validation
Next steps
Heartbeat overview
When to use heartbeat monitors.
Cron job guide
Patterns for background job monitoring.