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
1
Create the heartbeat monitor
expectedInterval and gracePeriod via YAML config-as-code or the API instead, as shown in the other tabs.The response includes a unique ping URL for this monitor.2
Get the ping URL
pingUrl field — it looks like:3
Add the ping to your job
Add a curl call at the end of your cron job or scheduled task:
4
Verify the first ping
Run your job once and confirm the ping arrived:
Configuration fields
The monitor opens an incident if no ping arrives within
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.