opyebCronPulse

Monitoring for the batch that never ran

Operations · 6 min read

One-line answer: Heartbeats, lateness alerts and drift detection: how to notice a job that fails silently.

The most dangerous batch failure is the one with no error. If the scheduler never starts the job, there is no stack trace and often no alert. You need to watch “did it run?” separately from “did it succeed?”.

Heartbeats

Send a signal to a monitoring service whenever the job finishes. The monitor alerts when the last signal is older than 1.5–2 times the expected interval: for an hourly job, warn after 90 minutes without a signal. Long jobs should send a start signal and an end signal separately.

# last line of the job
curl -fsS -m 10 https://monitor.example.com/ping/nightly-report   || echo "heartbeat failed" >&2

Lateness and drift

Record the gap between the scheduled time and the actual start. A growing gap points to scheduler load, a previous run that never finished, or a backlog. Watch duration as well as start time: when duration exceeds about 80% of the interval, the next run will collide.

Reducing alert fatigue

  • Deduplicate repeated failures into one alert.
  • Alert immediately for user-facing jobs, summarise internal housekeeping.
  • Send a recovery notice so people know it is over.

Daylight saving and monitoring

DST days are 23 or 25 hours long. A monitor that assumes “once a day” will false-alarm twice a year. Separate interval-based heartbeats from calendar-based checks and relax thresholds on transition days.

CheckThresholdAlert
End heartbeat1.5-2x the intervalno signal
Start latenessscheduled +30 minlate warning
Consecutive failures3escalation

The minimum set

If full coverage is too much, start with three things: an end-of-job heartbeat for critical jobs, an alert when a run is 30 minutes late, and an escalation after three consecutive failures. That catches most silent batch outages.

Paste an expression and see its next run times right away.

Open CronPulse

Frequently asked questions

Where should the heartbeat go?

To a monitoring service or an internal endpoint, ideally outside the same failure domain as the job. The point is that the absence of a signal is itself the alert.

How do I monitor a job with irregular runtime?

Send both start and end signals and alert when the end signal does not arrive within a duration threshold. Base the threshold on recent percentiles rather than a fixed number.

Sources

Related reading