ANOMALY_ INSIGHTS!UPDATE_ MONITOR_ CONFIG¶
Changes the scope of an existing anomaly monitor. The monitor keeps its name, anomaly history, and notification list.
Syntax¶
Arguments¶
'alias'Name of the monitor to update. The name isn’t case-sensitive.
Data type: VARCHAR
configConfiguration that defines the monitor’s scope. For the keys this object accepts and how to build a tag reference, see Monitor configuration.
Data type: VARIANT
Output¶
Returns a VARIANT that contains the monitor’s persisted configuration. The resource_tags and service_types keys are always present,
even when empty. Tags are returned in the resolved form, which names each tag instead of using a reference string. For an example,
see Monitor configuration.
The return value always contains the monitor’s full configuration, regardless of which keys you passed.
Access control requirements¶
Users with any of the following roles can call this method:
- ACCOUNTADMIN system role
- GLOBALORGADMIN system role
- SNOWFLAKE.APP_USAGE_ADMIN application role
To include a tag in the monitor’s configuration, you also need the APPLYBUDGET privilege on that tag. For more information, see
Access control for cost anomalies.
Usage notes¶
-
The method fails if no monitor with the specified name exists in the account. To create a monitor, use ANOMALY_INSIGHTS!CREATE_MONITOR.
-
Each top-level key in
configis interpreted independently:- If you omit a key, its current value is preserved.
- If you pass a key with a non-empty array, the new array replaces the current value.
- If you pass a key with an empty array, the current value is cleared.
-
A monitor’s scope can’t be empty. The method fails if the resulting configuration would have no tags in
resource_tags.tagsand no entries inservice_types. -
The method doesn’t recompute the monitor’s history. The next daily run picks up the new configuration. To refresh immediately, use ANOMALY_INSIGHTS!RECALCULATE_ANOMALIES.
-
The method is atomic. If validation fails, the monitor isn’t changed.
Examples¶
Replace the tags in a monitor’s scope, leaving its service types unchanged:
Remove all service types from a monitor, leaving its tags unchanged: