ANOMALY_INSIGHTS!GET_MONITOR_ANOMALIES

Returns the saved results for an anomaly monitor, and identifies which days are cost anomalies.

Syntax

SNOWFLAKE.LOCAL.ANOMALY_INSIGHTS!GET_MONITOR_ANOMALIES(
  '<alias>',
  '<start_date>',
  '<end_date>' )

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 nameData typeDescription
USAGE_DATEDATEDay in UTC when the consumption occurred.
CONSUMPTIONNUMBERAmount of consumption attributed to the monitor on this day.
FORECASTED_CONSUMPTIONNUMBERPredicted consumption based on the anomaly-detecting algorithm.
CURRENCY_TYPEVARCHARUnit of measure for the consumption, which corresponds to the monitor’s credit family.
LOWER_BOUNDNUMBERPredicted lowest level of consumption based on the anomaly-detecting algorithm. Consumption levels below this value are considered anomalies.
UPPER_BOUNDNUMBERPredicted highest level of consumption based on the anomaly-detecting algorithm. Consumption levels above this value are considered anomalies.
IS_ANOMALYBOOLEANIf TRUE, consumption fell outside the range defined by the lower and upper bounds, so Snowflake identified it as a cost anomaly.
ANOMALY_IDVARCHARSystem-generated identifier for the anomaly. Empty when IS_ANOMALY is FALSE.
LAST_REFRESHED_ATTIMESTAMPTime 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_date is earlier than start_date.
  • The range between start_date and end_date can’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:

CALL SNOWFLAKE.LOCAL.ANOMALY_INSIGHTS!GET_MONITOR_ANOMALIES(
  'Eng-Platform', '2026-01-01', '2026-03-31');

To use the output to identify the cost anomalies, look for the days where the value of the IS_ANOMALY column is TRUE.