Skip to content

Alert rules

Alert rules fire a webhook when a metric crosses a threshold for a given duration.

Terminal window
curl -X POST https://manage.yourdomain.com/api/alerts/rules \
-H "Authorization: Bearer sd_..." \
-H "Content-Type: application/json" \
-d '{"app_id":1,"metric":"cpu_pct","operator":">","threshold":80,"duration_sec":300,"webhook_id":1,"enabled":true}'
FieldTypeNotes
app_idintTarget app (omit / null for system-wide)
metricstringcpu_pct, mem_bytes, mem_pct
operatorstring>, <, >=, <=
thresholdfloatNumeric threshold
duration_secintSustained breach window before firing
webhook_idintWebhook to dispatch to
enabledboolToggle without deleting

Default rules can be created automatically from compose labels:

labels:
simpledeploy.alerts.cpu: ">80,5m"
simpledeploy.alerts.memory: ">90,5m"

Format: {operator}{threshold},{duration}. Rules created this way can be tuned or disabled later via the API/UI.

See also: Webhooks, Recipes, Compose labels.