Create monitor

Creates a monitor. Set detection_type to choose how the monitor raises incidents: anomaly when spend is unusual for its own history, threshold when total spend over evaluation_basis goes above or below threshold_trigger_value, trend when spend grows by more than trend_growth_pct over trend_basis, or forecast when spend is projected to go above threshold_trigger_value by the end of the month. Each type takes its own settings; the request examples show one body for each. detection_type defaults to anomaly and can't be changed after the monitor is created. A forecast monitor takes no group_by.
A threshold monitor with comparison_operator above can also set warning_levels: up to five whole percentages of threshold_trigger_value, each from 1 to 99, to warn before spend reaches the amount. They must be integers with no repeats, and default to [] (no warnings). The amount itself always alerts at 100%. A monitor with warning levels keeps one incident per series per window: it opens when spend crosses the lowest level and notifies again at each higher level crossed. Warning levels on a below monitor return 422, and so does warning_levels on any other type.
Threshold, Trend, and Forecast monitors are in preview. If your organization doesn't have the preview for a type, creating or updating a monitor of that type returns 422.
Fields left out take their defaults; cost_type defaults to REAL_COST. For what each cost type measures, see Cost Types. CUSTOM_COST is a cost calculation defined for your organization.
If another monitor in your organization already has the same detection_type and type settings, filter_set, group_by, threshold, and cost_type, the call returns 409 without creating a monitor, and error.existing_id names the existing one. A client that retries after a lost response can use that ID to pick up the monitor its first call created. Paused monitors count as a match and deleted monitors don't. The order of values in filter_set and group_by doesn't matter, and monitor_name, description, and is_enabled aren't compared.
group_by accepts at most one Dimension. Notification channels aren't set here; set them afterward with Update monitor notifications. Field validation failures return 422 with a details list.
CloudZero records the change in the activity log, attributed to "Set via API", after saving it. If that log write fails, the monitor is still created.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

An Anomaly monitor definition. Fields left out take their defaults.

string
enum
Defaults to REAL_COST

The type of cost to monitor.

length ≤ 1000

Optional human-readable description for the monitor

const
enum
Defaults to anomaly

The type of detection to perform: anomaly (spend unusual for its own history), threshold (spend over evaluation_basis crosses threshold_trigger_value), trend (spend grows by more than trend_growth_pct over trend_basis) or forecast (spend is projected to go above threshold_trigger_value by the end of forecast_horizon). Fixed once the monitor is created.

Allowed:
filter_set
object

Cost filters for the monitor: each key is a dimension and its value the list of values to include. An empty object is valid and watches all spend. Keys may be Dimension IDs (for example CZ:Service or User:Defined:Owner) or partition keys (for example services or costcontext:<dimension name>). Prefix a key with ! to exclude its values, & for a case-insensitive partial match, or both. On create/update, a non-empty filter_set must match cost in the last 30 days (422 otherwise).

group_by
array of strings
length ≤ 1

Dimensions to group by, as Dimension IDs or partition keys. Empty means no grouping; create/update requests are capped to a single dimension.

Group By
boolean
Defaults to true

Whether the monitor is running. When false the monitor will not be sent for evaluation.

string
required
length between 1 and 255

Human-readable name for the monitor

threshold
object

Optional significance threshold: an anomaly is surfaced as an incident only if its cost impact
meets it. Leave both min_cost_impact and percentage unset to surface every anomaly.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json