Monitoring glossary

Missed run

Also called: missed cron job, missed check-in, missed heartbeat

Definition

A missed run is a run of a job that was expected but never reported in. The monitor knew the job was due, waited through the grace period and heard nothing. That is different from a failed run: a failed run reports an error, while a missed run leaves no trace at all. Without a monitor, a missed run is often only noticed days later, when someone looks for its output.

Why runs get missed

  • The job never started. The server was off or rebooting, the cron daemon was stopped, the crontab line was removed in a deploy, or the job was paused and never resumed.
  • The job started but never finished. It hung on a network call, waited on a lock, or was killed for using too much memory.
  • The check-in was lost. The script exited before it reached the check-in, or the server could not reach the monitoring service.
  • The timing is off. The expected schedule in the monitor does not match the real one, often because of a timezone or daylight saving difference.

Missed run or failed run?

A failed run is the job telling you it went wrong, with a non-zero exit code or an explicit failure signal. You can alert on it the moment it happens. A missed run is the absence of any signal, so a monitor can only call it once the deadline, the due time plus the grace period, has passed.

Good monitoring catches both. Report failures explicitly for fast alerts, and keep a deadline as the backstop for everything that cannot report at all.

Example

How a missed run is detected

Expected schedule:  0 * * * *   (every hour, on the hour)
Grace period:       5 minutes

13:00  due   check-in at 13:02     on time
14:00  due   check-in at 14:01     on time
15:00  due   nothing by 15:05      deadline passed: missed run, alert sent
16:00  due   check-in at 16:03     on time, incident resolved
Expected schedule:  0 * * * *   (every hour, on the hour)
Grace period:       5 minutes

13:00  due   check-in at 13:02     on time
14:00  due   check-in at 14:01     on time
15:00  due   nothing by 15:05      deadline passed: missed run, alert sent
16:00  due   check-in at 16:03     on time, incident resolved

The 15:00 run left no trace on the server, but the monitor knew it was due. The alert goes out at the 15:05 deadline, not the next morning when someone notices a report is missing.

Common mistakes

  • Only alerting on errors. Error trackers and log alerts need the job to run and say something. A run that never started says nothing, so it never triggers them.
  • Skipping the check-in on purpose. If a job finds nothing to do and exits early without checking in, the monitor sees a missed run. Send the success check-in anyway, with a note that the run was skipped.
  • Several jobs on one monitor. If two jobs check in to the same monitor, a check-in from one can hide a missed run of the other. Give each job its own monitor.
  • A timezone mismatch. A job that runs at 02:00 local time, watched by a monitor that expects 02:00 UTC, looks missed every day, or, in a zone that matches UTC only in winter such as London, all summer. Set the monitor to the timezone the job runs in, and avoid times that the clock change skips or repeats.

How Drumbeats handles it

Drumbeats records a missed run as a Missed check-in incident (event MISSED) on cron and heartbeat monitors. It checks for overdue monitors every 30 seconds, so a missed run is detected within about 30 seconds of the deadline (the due time plus the grace period). A long outage stays one incident instead of one alert per missed run, and the next on-time success ping resolves it and sends a recovery message.

By default one missed run is enough to alert. If a job may skip now and then, raise the Missed check-ins setting so it takes several in a row. A new monitor starts watching for missed runs after its first ping arrives.

All glossary terms

Monitoring for scheduled work

Hear about the run that did not happen.

Your job pings Drumbeats when it finishes. If the ping does not arrive on time, you get an alert. No agent to install, free for up to 50 monitors.

Free for up to 50 monitors · Setup in 60 seconds · No credit card required