Monitors and alerts
An operation without a data team still needs to hear when a feed stops, a nightly build keeps failing or writeback to the ERP piles up in dead letters. Monitors are rules over the platform's own run records. Each rule watches one kind of resource, measures it every minute, opens an alert when its check fails, raises it when it gets worse and resolves it on its own when the condition clears. Alerts go by severity to email, Slack, Teams, a signed webhook or the inbox
In the platform today
- Monitors run in the platform service, defined under
monitors:inontology.yamlwithgroups,routesper severity,sendResolved,healthandrules, each with anid,scope, onecheck, aseverityand an optionalrunbook - Every 60 seconds by default, a service setting, the service measures each rule over
ops.pipeline_runs,ops.sync_runs,ops.automation_runs,ops.agent_runs,ops.aifunction_runs,ops.writeback_outbox,ops.webhook_deliveries,ops.edge_agentsandops.dataset_health, and evaluates dataset health on a timer when a rule watches datasets - Alerts are in
ops.monitor_alertsand their changes of state inops.monitor_events; they are sent as the webhook eventsmonitor.alert.opened,.escalatedand.resolvedthrough the webhook dispatcher, and listed and snoozed under/api/v2/monitorsand on the Monitors screen in Admin
- Rules over an app's dependencies, sync lag against the source, paging tools beyond a webhook, routes per rule, acknowledging an alert and opening an issue automatically
- An administrator to write rules in
ontology.yamland to run a pass by hand - Administrators and the groups in
monitors.groupsto see, receive and snooze alerts - Notification destinations under
notifications.destinations, or webhook subscriptions, for alerts to reach anyone outside the inbox - Runs to measure: a resource with no runs at all is not counted as quiet
Rules
A rule names what it watches with scope: a kind, which covers every resource of that kind including new ones as soon as they have a run, { kind: pipeline, resource: job-cost } for one, or a list of either. It has one check and a severity, low, medium (the default) or high. Rule ids are lower-case letters, digits, dots, dashes and underscores
monitors:
groups: [project-leads] # who sees and snoozes alerts, besides administrators
# per severity: a notification destination, webhook:<id> or inbox
routes:
high: [platform-email, inbox]
medium: [inbox]
low: []
sendResolved: true # also send when an alert resolves
# dataset health on a timer, when a rule watches datasets
health: { every: 1h, minGap: 15m }
rules:
- id: pipeline-failing
name: Pipeline failing
scope: pipeline # every pipeline
check: { consecutiveFailures: 2 }
severity: high
runbook: https://wiki.example/runbooks/pipelines
- id: erp-writeback
name: Writeback to the ERP dead-lettered
scope: { kind: writeback, resource: erp }
check: { failures: 1, window: 24h }
severity: high
- id: hangar-agent-quiet
scope: edge
check: { quietFor: 30m }
- id: feeds-health
scope: dataset
check: { health: [late, low, high], highFactor: 2, escalateAfter: 3 }
watch: { raw.pm_events: high, gold.notes: none }
What each kind reads
| Kind | Read from | A run is | Failed when |
|---|---|---|---|
pipeline | ops.pipeline_runs | A build | Its status is failed |
sync | ops.sync_runs | An object sync | Its status is failed |
automation | ops.automation_runs | An automation run | Its status is failed |
agent | ops.agent_runs | An agent run | It failed, or stopped at its step or cost limit |
aifunction | ops.aifunction_runs | An AI function run | Its status is failed |
writeback | ops.writeback_outbox, by system | A writeback that finished | It reached the dead letters |
webhook | ops.webhook_deliveries, by destination | A delivery that finished | It failed for good |
edge | ops.edge_agents | A heartbeat | Heartbeats only go quiet |
dataset | ops.dataset_health | A health evaluation | Late, low volume or high volume |
Runs still in progress, pending, retrying, skipped or muted, are not counted
Checks
| Check | Fails when |
|---|---|
{ consecutiveFailures: 3 } | The latest 3 runs all failed |
{ failures: 1, window: 24h } | At least 1 run failed in the window, such as any dead letter |
{ failureRate: 0.25, window: 24h, minRuns: 5 } | A quarter or more of the window's runs failed, once it has 5 runs |
{ p95Above: 10m, window: 24h, minRuns: 5 } | The 95th percentile run time in the window is above 10 minutes |
{ quietFor: 6h } | No run or heartbeat for 6 hours. A resource that never ran is not quiet |
{ emptyLoad: true } | A pipeline's latest successful build wrote no rows, or a dataset's latest load had none |
{ health: [late, low, high] } | A dataset is late, or below or above its usual volume. The default is all three |
Dataset health on a timer
Dataset health learns each dataset's usual freshness and volume. When a rule watches datasets, each monitor pass evaluates every dataset again when one has a new version or has passed its expected update time, at most every health.minGap (15 minutes) and at least every health.every (1 hour), so the health screen stays whole
- Two severities. The rule's own severity for health's bounds, and high when the dataset is also outside bounds
highFactortimes looser (2 by default: late by twice the allowed gap, or rows below the low bound halved or above the high bound doubled) - Escalation.
escalateAfter: 3raises the severity one step once the dataset has failed 3 evaluations in a row - Watch. Per dataset,
all(the default) watches it,highalerts only at high, andnoneleaves it out - History. Rows of
ops.dataset_healtholder than 30 days are removed
Alerts
There is one alert per rule and resource while the condition holds. It opens when the check fails and resolves on its own at the first pass where the check holds again, including when the rule or the resource goes away. If the condition comes back, a new alert opens. Each alert keeps its current value against the threshold and a short series of the measured value, one point at most every five minutes, the last 48
| Change | When | Sent |
|---|---|---|
| Opened | The check fails for a resource with no open alert | To the routes of its severity |
| Escalated | The measured severity rises | To the routes of the new severity |
| Lowered | The measured severity falls while the alert stays open | Recorded only |
| Resolved | The check holds again | When sendResolved is true, the default |
| Snoozed, unsnoozed | Someone snoozes it with a reason and an end time, or lifts the snooze | Recorded and audited |
| Snooze ended | The end time passes with the alert still open | To the routes again |
While an alert is snoozed nothing is sent, and it still resolves on its own. Every change is a row in ops.monitor_events. Resolved alerts and changes are kept 30 days. Alerts, events and windows are on the platform clock
Routes and messages
routes sends each severity to destinations
- A notification destination by name, email, Slack or Teams from
notifications.destinations webhook:<subscription id>for a signed webhookinboxfor the in-app inbox of administrators and the monitor groups
Messages are webhook events written to ops.webhook_events and queued in ops.webhook_deliveries, so they go out with the dispatcher's retries, dead letters, templates and mutes. A webhook subscription or notification route that names monitor.* events gets them too. Only administrators and the monitor groups may receive them: a destination's runAs, audience or email recipients are checked as for any event
{
"type": "monitor.alert.opened",
"data": {
"id": "mon_01JB4V…",
"rule": "pipeline-failing",
"ruleName": "Pipeline failing",
"kind": "pipeline",
"resource": "fleet",
"resourceName": "Fleet status",
"severity": "high",
"state": "open",
"value": 2,
"threshold": 2,
"message": "2 failed builds in a row",
"runbook": "https://wiki.example/runbooks/pipelines",
"change": "opened"
}
}
The event carries the signing headers and envelope described on webhooks; the data fields are shown here
API
| Endpoint | Does |
|---|---|
GET /api/v2/monitors/rules | Rules with their open alert counts, routes, groups, problems in the configuration and the timer's last pass |
GET /api/v2/monitors/alerts | Alerts, highest severity first. state is open (the default), resolved or all, and severity, rule and limit narrow the list |
GET /api/v2/monitors/alerts/{id} | One alert: its value against the threshold, its series, its changes and recent runs |
POST /api/v2/monitors/alerts/{id}:snooze | {"reason": "…", "until": "<time>"} or {"reason": "…", "for": "4h"} |
POST /api/v2/monitors/alerts/{id}:unsnooze | Lifts a snooze |
POST /api/v2/monitors:evaluate | Administrators: one pass now, with dataset health |
The listing and alert routes are for administrators and the monitor groups; anyone else gets 403 MONITORS_VIEWER_ONLY. Snoozes and passes run by hand are audited as monitor.snoozed, monitor.unsnoozed and monitor.evaluated.
Limitations
- A rule has one check. Two conditions on the same resource are two rules, each with its own alert
- Routes are set per severity for the whole ontology. Routes per rule are delivered on request
- An alert can be snoozed but not acknowledged; acknowledgement and an issue opened automatically for an alert are delivered on request
- Rules over everything an app depends on, and sync lag against the source system, are delivered on request
- Paging tools are reached through a signed webhook; direct integrations with them are delivered on request
- A resource with no runs at all is not quiet, so a new pipeline that does not start raises no
quietForalert