ANOMALY_ INSIGHTS!GET_ MONITOR_ ANOMALIES¶
Returns the saved results for an anomaly monitor, and identifies which days are cost anomalies.
Syntax¶
Arguments¶
'alias'Name of the monitor. The name isn’t case-sensitive.
Data type: VARCHAR
'start_date'Specifies the beginning of the time period for which consumption data is returned.
Data type: DATE
'end_date'Specifies the end of the time period for which consumption data is returned.
Data type: DATE
Output¶
Returns a table with one row per day in the time period, with the following columns:
| Column name | Data type | Description |
|---|---|---|
| USAGE_DATE | DATE | Day in UTC when the consumption occurred. |
| CONSUMPTION | NUMBER | Amount of consumption attributed to the monitor on this day. |
| FORECASTED_CONSUMPTION | NUMBER | Predicted consumption based on the anomaly-detecting algorithm. |
| CURRENCY_TYPE | VARCHAR | Unit of measure for the consumption, which corresponds to the monitor’s credit family. |
| LOWER_BOUND | NUMBER | Predicted lowest level of consumption based on the anomaly-detecting algorithm. Consumption levels below this value are considered anomalies. |
| UPPER_BOUND | NUMBER | Predicted highest level of consumption based on the anomaly-detecting algorithm. Consumption levels above this value are considered anomalies. |
| IS_ANOMALY | BOOLEAN | If TRUE, consumption fell outside the range defined by the lower and upper bounds, so Snowflake identified it as a cost anomaly. |
| ANOMALY_ID | VARCHAR | System-generated identifier for the anomaly. Empty when IS_ANOMALY is FALSE. |
| LAST_REFRESHED_AT | TIMESTAMP | Time when Snowflake last finished computing results for the monitor. This value is the same for every row. |
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
- SNOWFLAKE.APP_USAGE_VIEWER application role
Usage notes¶
- The method fails if no monitor with the specified name exists in the account, or if
end_dateis earlier thanstart_date. - The range between
start_dateandend_datecan’t exceed 366 days. To retrieve a longer history, call the method more than once with consecutive ranges. - The method reads saved results. It doesn’t recompute them. To force a recomputation, use ANOMALY_INSIGHTS!RECALCULATE_ANOMALIES.
Example¶
Return the results for the monitor Eng-Platform between January 1, 2026, and March 31, 2026:
To use the output to identify the cost anomalies, look for the days where the value of the IS_ANOMALY column is TRUE.