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
1
Create the monitor
expectedInterval and gracePeriod via YAML config-as-code (shown above) or the API.2
Get the ping URL
pingUrl from the response.3
Add the ping to your job
Add a curl at the end of your script:Using
curl -fsS ensures the ping is only sent on HTTP success. If the script fails (set -e), the curl never runs and DevHelm eventually alerts.Common intervals
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.