Schema:

ACCOUNT_USAGE

SNOWFLAKE_APP_RUNTIME_COMPUTE_HISTORY view

The SNOWFLAKE_APP_RUNTIME_COMPUTE_HISTORY view in the ACCOUNT_USAGE schema returns the hourly compute credit usage for Snowflake App Runtime in an account within the last 365 days (1 year).

Each row is one hour of usage for one compute type. Use COMPUTE_TYPE to tell the rows apart:

  • MANAGED COMPUTE POOL: account-level usage on the shared Snowflake-managed compute pool. COMPUTE_POOL_NAME is SNOWFLAKE_APP_RUNTIME_COMPUTE. The application service and user columns are NULL. Per-app cost attribution isn’t available for these rows.
  • SERVERLESS: usage attributed to one application service. APPLICATION_SERVICE_ID and APPLICATION_SERVICE_NAME identify the service. COMPUTE_POOL_NAME and USER_ID are NULL.
  • PREVIEW: usage attributed to the user who ran a Snowflake App Runtime preview on Workspaces. USER_ID identifies that user. COMPUTE_POOL_NAME and the application service columns are NULL.

Columns

Column NameData TypeDescription
START_TIMETIMESTAMP_LTZThe date and beginning of the hour (in the local time zone) in which the usage took place.
END_TIMETIMESTAMP_LTZThe date and end of the hour (in the local time zone) in which the usage took place.
COMPUTE_POOL_NAMEVARCHARName of the Snowflake-managed compute pool. SNOWFLAKE_APP_RUNTIME_COMPUTE when COMPUTE_TYPE is MANAGED COMPUTE POOL; NULL for serverless and preview rows.
CREDITS_USEDNUMBERNumber of credits used for this row in the hour.
APPLICATION_SERVICE_IDNUMBERIdentifier of the application service. Populated when COMPUTE_TYPE is SERVERLESS; otherwise NULL.
APPLICATION_SERVICE_NAMEVARCHARName of the application service. Populated when COMPUTE_TYPE is SERVERLESS; otherwise NULL.
USER_IDNUMBERIdentifier of the user associated with the usage. Populated when COMPUTE_TYPE is PREVIEW; otherwise NULL.
COMPUTE_TYPEVARCHARKind of App Runtime compute for the row: MANAGED COMPUTE POOL, SERVERLESS, or PREVIEW.

Usage notes

  • Latency for the view may be up to 180 minutes (3 hours).
  • Managed compute pool rows are one row per account per hour. Serverless rows are one application service per hour. Preview rows are one user per hour.
  • Credit usage reported here is also included in METERING_HISTORY and METERING_DAILY_HISTORY. SERVICE_TYPE in those views depends on COMPUTE_TYPE:
    • MANAGED COMPUTE POOL is reported as SNOWFLAKE_APP_RUNTIME.
    • SERVERLESS is reported as SNOWFLAKE_APP_RUNTIME_SERVERLESS.
    • PREVIEW is reported as SNOWFLAKE_APP_RUNTIME_PREVIEW.

Examples

Return daily Snowflake App Runtime credit usage for the last 30 days:

SELECT
    DATE(start_time) AS usage_date,
    SUM(credits_used) AS credits_used
FROM snowflake.account_usage.snowflake_app_runtime_compute_history
WHERE start_time >= DATEADD('day', -30, CURRENT_TIMESTAMP())
GROUP BY usage_date
ORDER BY usage_date DESC;

Return daily credit usage by compute type and application service for the last 30 days:

SELECT
    DATE(start_time) AS usage_date,
    compute_type,
    application_service_name,
    SUM(credits_used) AS credits_used
FROM snowflake.account_usage.snowflake_app_runtime_compute_history
WHERE start_time >= DATEADD('day', -30, CURRENT_TIMESTAMP())
GROUP BY usage_date, compute_type, application_service_name
ORDER BY usage_date DESC;