Prerequisites
Prerequisites
- DevHelm CLI installed or an API token for REST calls
- An API token set as
DEVHELM_API_TOKEN— see Authentication - A cron job, background worker, or scheduled task to monitor
How heartbeats work
Unlike other monitor types where DevHelm checks your service, heartbeat monitors work in reverse — your service pings DevHelm. If DevHelm doesn’t receive a ping within the expected interval plus a grace period, it opens an incident.Create the monitor
Configuration fields
| Field | Type | Description |
|---|---|---|
expectedInterval | integer | Expected seconds between pings (e.g., 86400 for daily) |
gracePeriod | integer | Extra seconds to wait before declaring the job late |
expectedInterval + gracePeriod seconds after the last ping.
Common patterns
Cron jobs
Cron jobs
For a job that runs every hour, set
expectedInterval: 3600 and gracePeriod: 300 (5 minutes of slack).Kubernetes CronJobs
Kubernetes CronJobs
Add a curl sidecar or post-completion hook that pings DevHelm after the job container exits successfully.
Background workers
Background workers
For long-running workers that process queues, add a periodic heartbeat in your main loop (e.g., every 5 minutes).
Ping only on success
Ping only on success
Use
curl -fsS so the ping is only sent on HTTP success. If your script fails, the ping is skipped and DevHelm eventually opens an incident.Next steps
Heartbeat reference
Full heartbeat configuration and assertion details.
Cron job monitoring
Advanced patterns for scheduled task monitoring.
First alert
Get notified when a heartbeat goes silent.