How to get alerted when a cron job silently stops running
Failure alerts miss a cron job that stops running. Alert on scheduled times since the last success instead, with no ping code in the job.
A cron job that stops running sends no error, so an alert on failures never
fires for it. You need a check that counts the scheduled times since the
last success. On Gregale that is the cron_missed_runs alert metric:
gregale alert preset enable cron_missed --app my-api --channel CHANNEL_ID
watches every enabled production cron of the app and fires once one has gone
3 scheduled times without a successful run, whether its runs fail, stop
starting, or the app has no live deployment.
Gregale publishes this page. The commands and rules come from the Alerts and Crons docs; the timings are from our own test on December 1, 2026, described below.
Failing is not the same as stopped
A scheduled job can go wrong in two ways, and they need different alerts:
- Its runs fail. The job starts, then returns an error or times out. Each failure is an event, so an error-rate or failure-count alert sees it.
- It stops running. The app was deleted or never redeployed, a deploy dropped the schedule, a spend limit held it, or the platform paused it after repeated failures. Nothing runs, so nothing fails, and a failure alert stays quiet for as long as the job is gone.
The second case is the one people find weeks later, when a report is missing or a table has stopped growing. The usual fix is a "dead man's switch": the job pings a monitoring URL after each success, and the monitor alerts when the ping stops. That works anywhere, but it is one more service to sign up for, and every job needs the ping added to its code.
On Gregale the scheduler already knows when each cron was due and whether a run succeeded, so the check needs no code in the job and no outside monitor.
Set it up
Alerts go to a notification channel: Slack, PagerDuty or your account's email. Create one once per account and send it a test:
# Slack: create an incoming webhook in Slack, then paste its URL.
printf '%s\n' "$SLACK_WEBHOOK_URL" | gregale alert channel create --name ops-slack --kind slack --secret-stdin
gregale alert channel test CHANNEL_ID
Then turn on the preset for each app that has crons:
gregale alert preset enable cron_missed --app my-api --channel CHANNEL_ID
The preset watches every enabled production cron of the app and fires when one
of them reaches 3 scheduled times since its last success. It reports the cron
that missed the most. For a single important job, or a different threshold,
create the rule yourself with the cron's id from gregale cron list:
gregale cron list --app my-api
# Fire after two missed runs of the billing cron:
gregale alert create --app my-api --name "Billing cron stopped" \
--metric cron_missed_runs --cron 3f2c9d1e-0b7a-4c55-9f1e-2d6a8b4c7e10 \
--comparison gte --threshold 2 --window-spec 1h --channel CHANNEL_ID
The threshold is a whole number of scheduled times, compared with gt or
gte; the window does not apply to this metric. Without --cron the rule
watches every enabled production cron of the app.
What counts as missed
- A scheduled time counts 15 minutes after it passed if no run has succeeded since. For a command cron, its command timeout is added. So an hourly job with a threshold of 2 alerts about 75 minutes after its last good run.
- Every cause counts the same way: runs that fail, runs that never start, a cron Gregale paused after its runs kept failing, an app with no live deployment, or a budget hold.
- Changing the schedule, enabling the cron or the end of a pause starts the count again, so a fixed job does not alert on its old misses.
- Crons you disabled yourself are not watched. Turning a job off on purpose is not an incident.
- Stage crons are not watched yet. The rule covers production, so it cannot
be created with
--env.
A changed schedule or path in gregale.yaml replaces the cron with a new id.
A rule that names a cron that no longer exists shows degraded in
gregale alert list instead of quietly counting zero; point it at the new id
with gregale alert update RULE_ID --cron NEW_ID.
Also alert on the first failure
A missed-run alert waits for the threshold. To hear about the first failed run
as well, add a failure rule. failed_invocations with --failure-source cron
counts failed cron runs, and --cron narrows it to one job:
gregale alert create --app my-api --name "cron failures" --metric failed_invocations \
--failure-source cron --comparison gte --threshold 1 --window-spec 1h --channel CHANNEL_ID
The two rules cover each other: the failure rule is fast but sees only runs that started, and the missed-run rule is slower but sees a job that stopped.
What the alert tells you
On a Slack, PagerDuty or email channel, the alert carries details. The notification names the late crons, up to 5: what each runs, how many scheduled times it missed, its last success, and why Gregale paused it, if it did. A failure notification lists the newest failed runs: the path, the cron, the number of attempts and the last error, cut to one line of 200 bytes. A webhook delivery carries the metric, the observed value and the threshold, as in the test below. That text reaches every channel the rule delivers to, so keep secrets out of your error messages.
Our test
We deployed a small FastAPI app with two crons that each ran every minute:
/cron/ok answered 200 and /cron/broken answered 500. Then we turned on the
cron_missed preset, a cron_missed_runs rule on the broken cron with a
threshold of 2, and a failed_invocations rule for cron runs, all delivering
to a webhook on the same app.
The cron runs started failing at 08:06 UTC, and we created the rules about a minute later:
| Rule | Fired (UTC) | Observed |
|---|---|---|
failed_invocations, cron runs, gte 1 | 08:07:41 | 2 failed runs |
cron_missed_runs on the broken cron, gte 2 | 08:22:41 | 2 missed times |
cron_missed preset, gte 3 | 08:23:41 | 3 missed times |
The failure rule fired on its first evaluation. The missed-run rules fired
exactly 15 minutes after the second and third failed scheduled times, as the
grace period says. The healthy /cron/ok cron never counted toward either
missed-run rule. Each webhook delivery carried the metric, the observed value
and the threshold:
{
"rule_name": "broken cron stopped",
"payload": {
"event": "alert.fired",
"metric": "cron_missed_runs",
"observed": 2,
"comparison": "gte",
"threshold": 2,
"window": "1h"
}
}
gregale alert deliveries RULE_ID --app my-api lists every delivery with its
HTTP status, so a receiver that was down shows up there.
Find out why the job stopped
gregale cron get CRON_ID # last run, recent failures, and why it is suspended
gregale cron runs CRON_ID # recent runs with outcome and error
gregale cron run CRON_ID --wait # run it now; exits 1 if it fails
The most common cron failure is application returned HTTP 404: the run
reached your app, but nothing handles POST at the cron's path. A handler that
serves only GET answers 405 instead, because crons always send POST.
Gregale pauses an HTTP cron that keeps failing, so it stops running billed
failures: after at least 10 failures in a row, the first of them more than a
day old. Your account gets an email and gregale cron get CRON_ID shows
suspended_reason: failing. Fix the cause, then deploy or run
gregale cron update CRON_ID --enable to resume it. A cron whose app has no
live deployment is suspended with no_live_deployment and resumes on the next
successful deploy.
Plans
Crons and alerts need Hobby or above. Hobby ($10 a month) allows 5 crons per app, Pro ($30) 20 and Scale ($99) 100. A cron run is billed like any other request, at the app's plan RAM for every second it runs. See Crons, Alerts and pricing.
Questions
- Why did my cron job stop running without any error?
A job that never starts produces no failure to report. Common causes are an app that was deleted or has no live deployment, a deploy that dropped the schedule, a spend limit that held it, or a platform that paused it after repeated failures. On Gregale, gregale cron get CRON_ID shows the cron’s last run, its recent failures and why it is suspended, if it is.
- How do I monitor a cron job without a dead man’s switch service?
Use a check that counts scheduled times since the last successful run. On Gregale, gregale alert preset enable cron_missed --app my-api --channel CHANNEL_ID watches every enabled production cron of the app and alerts once one has gone 3 scheduled times without a success, with no ping in the job’s code.
- When does a missed cron run count?
A scheduled time counts as missed 15 minutes after it passed if no run has succeeded since, plus the command timeout for a command cron. Changing the schedule, enabling the cron or the end of a pause starts the count again, and crons you disabled yourself are not watched.
- Should I alert on failed cron runs too?
Yes. A failure rule (failed_invocations with --failure-source cron) fires on the first failed run but never sees a job that stopped starting; a missed-run rule sees both but waits for its threshold. Use both.