Prerequisites
Prerequisites
- DevHelm CLI installed or an API token
- One or more cron jobs or scheduled tasks to monitor
The heartbeat pattern
Standard monitors work by checking your service outbound. For cron jobs, the pattern is reversed — your job pings DevHelm after each successful run. If DevHelm doesn’t receive a ping within the expected window, it opens an incident.Set up a heartbeat monitor
Create the monitor
| Config field | Value | Meaning |
|---|---|---|
expectedInterval | 86400 | Job runs every 24 hours |
gracePeriod | 3600 | Allow 1 hour of slack before alerting |
Common intervals
| Job | expectedInterval | gracePeriod |
|---|---|---|
| Every minute | 60 | 30 |
| Hourly | 3600 | 300 (5 min) |
| Daily | 86400 | 3600 (1 hour) |
| Weekly | 604800 | 86400 (1 day) |
Advanced patterns
Kubernetes CronJobs
Kubernetes CronJobs
Add a post-completion container or use a
completions-based Job with a sidecar:Long-running workers
Long-running workers
For workers that process queues continuously, add a periodic heartbeat in the main loop:
Multiple jobs, one config
Multiple jobs, one config
Define all heartbeat monitors in a single YAML file:
Ping only on success
Ping only on success
Always use
set -e or equivalent error handling so the ping is skipped when the job fails. This way DevHelm catches both “job didn’t run” and “job ran but failed” scenarios.Next steps
Heartbeat reference
Full heartbeat configuration and assertions.
First alert
Get notified when a heartbeat goes silent.
Monitoring as Code
Manage all heartbeat monitors in YAML.