Slow run alerts
A job can succeed and still be a problem when it suddenly takes five times longer than normal. Slow run alerts compare each run with the recent past and notify you, without opening an incident.
What is it for
Section titled “What is it for”Many failures start as slowness: a table that grew, a disk that fills up, an API that throttles. A slow run alert warns you early, while the job still succeeds.
When to use it
Section titled “When to use it”On jobs that send /start and a success ping and run for at least a minute or so, where the normal run time is
stable. Skip it for jobs whose run time varies a lot by design.
How it works
Section titled “How it works”You set a slow run factor on the monitor, a number from 1.5 to 50. When a success ping arrives and
CronBeat knows the run time, it compares it with the median run time of the last 20 successful runs. If the
run is longer than median x factor, a slow run alert is sent.
Conditions, all of which must hold:
- The job sends a
/startping before the success ping, or the run time is known some other way (the Kubernetes agent reports durations). Without a measured duration there is nothing to compare, see Ping endpoints. - At least 10 earlier successful runs with a duration exist.
- The run took at least 30 seconds. Short jobs never raise a slow run alert.
- The monitor is not in a maintenance window.
Example: the median is 2 minutes and the factor is 3. A run of 7 minutes (longer than 6) sends an alert, a run of 5 minutes does not.
What you receive
Section titled “What you receive”- A message on every notification channel of the monitor, with the reason
slow_runand a detail such astook 7m 12s, usually 2m 3s. - On webhooks the event is
monitor.slow, see Signed webhooks. - PagerDuty does not receive slow run alerts, because they are not incidents and have nothing to resolve.
- It is a one-off message. No incident is opened, so there is no recovery message and no reminder, and the monitor
status stays
up.
Slow runs versus maximum runtime
Section titled “Slow runs versus maximum runtime”The maximum runtime is a hard limit that turns the monitor down when
a run exceeds it. A slow run alert is a soft warning that adapts to how long your job normally takes. You can use
both on the same monitor.
What happens when
Section titled “What happens when”| Situation | Result |
|---|---|
| Factor 3, median 2 minutes, a run takes 7 minutes | An informational alert goes to all channels of the monitor except PagerDuty. No incident. |
| The same run takes 5 minutes | Nothing. |
| The monitor has fewer than 10 earlier runs | Nothing yet, CronBeat is still learning the normal run time. |
| The run took 20 seconds, ten times the median | Nothing. Runs shorter than 30 seconds are never reported. |
| The job also has a maximum runtime of 6 minutes | The 7 minute run is down (too_long) as well, with a normal incident. |

