Schema:

ACCOUNT_USAGE

SERVERLESS_ALERT_HISTORY view

This Account Usage view can be used to query the serverless alert usage history. The information returned by the view includes the serverless alert name and credits consumed by serverless alert usage.

See also:

SERVERLESS_ALERT_HISTORY function

Columns

Column NameData TypeDescription
START_TIMETIMESTAMP_LTZStart of the specified time range.
END_TIMETIMESTAMP_LTZEnd of the specified time range.
CREDITS_USEDVARCHARNumber of credits billed for serverless alert usage during the START_TIME and END_TIME window.
ALERT_IDNUMBERInternal/system-generated identifier for the serverless alert.
ALERT_NAMEVARCHARName of the serverless alert.
SCHEMA_IDNUMBERInternal/system-generated identifier for the schema that contains the serverless alert.
SCHEMA_NAMEVARCHARName of the schema that contains the serverless alert.
DATABASE_IDNUMBERInternal/system-generated identifier for the database that contains the serverless alert.
DATABASE_NAMEVARCHARName of the database that contains the serverless alert.

Usage notes

  • Latency for the view may be up to 180 minutes (3 hours).

Example

The following SQL statement queries for the credits used by the two most recent executions of serverless alerts:

SELECT
    start_time,
    end_time,
    alert_id,
    alert_name,
    credits_used,
    schema_id,
    schema_name,
    database_id,
    database_name,
  FROM SNOWFLAKE.ACCOUNT_USAGE.SERVERLESS_ALERT_HISTORY
  LIMIT 2;
+---------------------------------+---------------------------------+----------+---------------------+--------------+-----------+-------------+-------------+---------------+
|           START_TIME            |            END_TIME             | ALERT_ID |     ALERT_NAME      | CREDITS_USED | SCHEMA_ID | SCHEMA_NAME | DATABASE_ID | DATABASE_NAME |
+---------------------------------+---------------------------------+----------+---------------------+--------------+-----------+-------------+-------------+---------------+
| Tue, 10 Sep 2024 17:57:00 -0700 | Tue, 10 Sep 2024 17:58:00 -0700 | 202      | MY_SERVERLESS_ALERT | 0.000869065  | 52        | SCTEST      | 30          | DBTEST        |
| Tue, 10 Sep 2024 18:57:00 -0700 | Tue, 10 Sep 2024 18:58:00 -0700 | 202      | MY_SERVERLESS_ALERT | 0.000841918  | 52        | SCTEST      | 30          | DBTEST        |
+---------------------------------+---------------------------------+----------+---------------------+--------------+-----------+-------------+-------------+---------------+