Automatic incidents
When the runtime opens an incident by itself, and how it closes one.
With incidents.enabled, a check run can open, progress and resolve
incidents on its own. Automatic incidents are marked auto: true, and only
those are reconciled — an incident you opened by hand is never touched by the
monitoring loop.
stateDiagram-v2 [*] --> investigating: failures reach failureThreshold investigating --> monitoring: a check succeeds monitoring --> investigating: it fails again monitoring --> resolved: five minutes of stability resolved --> [*]
Opening
On each run, for every failing monitor not covered by an in-progress
maintenance window:
- Trailing consecutive failures are counted from persisted history, once for the whole batch.
- If no active automatic incident already covers the monitor, and the count
has reached
notifications.failureThreshold, an incident is created.
The generated incident is:
An incident covers a monitor when its affectedMonitors contains the name —
or is empty, which means global.
Recovering
When a monitor that has an open automatic incident succeeds:
- the incident moves to
monitoringwith"<monitor> has recovered. Monitoring stability.", and - once it has been
monitoringfor five minutes, it is resolved with"<monitor> has remained operational for five minutes. Resolved.".
The five-minute timer is the timestamp of the monitoring timeline entry, not
a process timer, so it survives restarts, redeploys and serverless invocations
that share nothing.
If the monitor fails again while the incident is monitoring, the incident
returns to investigating with
"<monitor> is failing again. Continuing investigation." — a single flapping
check can never resolve an outage early.
Events
| Transition | Event |
|---|---|
| Incident opened | incident.created |
Moved to monitoring | incident.updated |
Back to investigating | incident.updated |
| Resolved after stability | incident.resolved |
These are dispatched together with the monitor events from the same run, so a
channel sees monitor.down and incident.created in one batch.
Tuning
| Goal | Change |
|---|---|
| Fewer incidents from flaky checks | Raise notifications.failureThreshold or enable softFail on HTTP. |
| Faster paging | Lower failureThreshold, or shorten checks.interval. |
| No automatic incidents at all | incidents: { enabled: false }, or keep incidents manual by raising the threshold out of reach. |
| Silence during planned work | Schedule a maintenance window covering the monitors. |
failureThreshold is shared with notifications on purpose: the moment a
monitor is considered down is one decision, not two that can drift apart.
Interaction with manual incidents
- Manual incidents (
auto: false) are never auto-updated or auto-resolved. - An automatic incident can be edited by hand through
PATCH /admin/incidents/:id; it keepsauto: trueand remains eligible for automatic resolution. - To stop reconciliation on one incident, resolve it — reconciliation only
looks at
investigating,identifiedandmonitoring.
Automatically opened incidents use major. Promote one to critical by
hand when it warrants an outage banner and a Slack mention — the runtime
will not guess that from a failing check.