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 Name

Data Type

Description

START_TIME

TIMESTAMP_LTZ

Start of the specified time range.

END_TIME

TIMESTAMP_LTZ

End of the specified time range.

CREDITS_USED

TEXT

Number of credits billed for serverless alert usage during the START_TIME and END_TIME window.

ALERT_ID

NUMBER

Internal/system-generated identifier for the serverless alert.

ALERT_NAME

TEXT

Name of the serverless alert.

SCHEMA_ID

NUMBER

Internal/system-generated identifier for the schema that contains the serverless alert.

SCHEMA_NAME

TEXT

Name of the schema that contains the serverless alert.

DATABASE_ID

NUMBER

Internal/system-generated identifier for the database that contains the serverless alert.

DATABASE_NAME

TEXT

Name 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;
Copy
+---------------------------------+---------------------------------+----------+---------------------+--------------+-----------+-------------+-------------+---------------+
|           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        |
+---------------------------------+---------------------------------+----------+---------------------+--------------+-----------+-------------+-------------+---------------+
Language: English