/v2/insights/alert-rulesCreate an alert rule
Creates an alert rule for a metric query and its configured thresholds. Provide a spec with name, query, thresholds, and at least one notification_channels binding; status defaults to ALERT_RULE_STATUS_ACTIVE and re_alert_duration defaults to RE_ALERT_DURATION_4H when omitted. Use a dotted OpenTelemetry metric name for query.metric, such as do.droplets.cpu_utilization.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Alert rule creation details. spec is required and must include name, query, thresholds, and at least one notification_channels binding.
A 400 is returned when the request body cannot be parsed, a 401 when authentication fails, a 422 when query.metric uses an underscored Prometheus-style name, a 429 when the API rate limit is exceeded, and a 500 when a server error occurs. spec must include name, query, thresholds, and at least one notification_channels binding; status, if provided, must be ALERT_RULE_STATUS_ACTIVE or ALERT_RULE_STATUS_PAUSED.