Alert rules
Server metric alert rules: metrics, comparisons, durations and recovery notifications.
Alert rules watch the metrics your agents report. A rule fires when its condition holds for notify_after minutes, opening an incident and notifying its recipients.
Fields
| Field | Description |
|---|---|
server_ids | Servers to watch. Empty array = all servers, including ones added later. |
metric | See below. |
compare | HIGHER, LOWER, EQUAL, DOESNT_EQUAL |
value | Threshold. |
notify_after | Minutes the condition must hold before alerting. |
notify_on_close | Send a recovery alert when the condition clears. |
channel_ids | Recipients to notify. |
Metrics
| Metric | Meaning | Unit |
|---|---|---|
down | Server stopped reporting (no compare/value needed) | — |
CPU_overall | CPU busy | % |
MEM_used | Memory used | % |
MEM_free | Memory free | % |
CPU_temp | CPU temperature | °C |
CPU_loadavg | 1-minute load average | — |
DISK_used | Highest usage across mounts | % |
Example
curl -X POST https://api.statance.com/v1/alerts \
-H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"server_ids":[],"metric":"CPU_overall","compare":"HIGHER","value":90,
"notify_after":10,"notify_on_close":true,"channel_ids":["ch_..."]}'Next: Notifications →