Cost and credit usage

This topic describes how Snowflake bills compute used by Snowflake App Runtime and where to track that usage.

How App Runtime compute is billed

Snowflake App Runtime usage appears in METERING_HISTORY and METERING_DAILY_HISTORY under these service types:

Service typeDescription
SNOWFLAKE_APP_RUNTIMECompute used to build and host Snowflake App Runtime services on managed compute.
SNOWFLAKE_APP_RUNTIME_SERVERLESSCompute used to run Snowflake App Runtime services on serverless compute (compute_resource: SERVERLESS).
SNOWFLAKE_APP_RUNTIME_PREVIEWCompute used to preview Snowflake App Runtime apps in Snowsight Workspaces.

How credits are attributed depends on the app’s compute resource:

  • Managed compute. All apps in an account share Snowflake-managed compute. Snowflake bills credit usage at the account level under the SNOWFLAKE_APP_RUNTIME service type, separate from your warehouses and other compute. You can’t see credits for individual apps.
  • Serverless compute. Snowflake reports credits for each Application Service under the SNOWFLAKE_APP_RUNTIME_SERVERLESS service type, so you can see what each app costs. See Find credit usage for each app.
  • Workspaces preview. Snowflake reports credits for the user who ran the preview under the SNOWFLAKE_APP_RUNTIME_PREVIEW service type. See Find credit usage for Workspaces preview.

Credit rate

Managed compute credits are charged per compute-hour at the rate listed in the Snowflake Service Consumption Table under “Serverless Feature Credit Table” for the SNOWFLAKE_APP_RUNTIME service type. Managed compute uses CPU_X64_S nodes (3 vCPU, 13 GiB RAM). This rate reflects a discount relative to the equivalent self-managed SPCS compute pool node rate.

You aren’t billed per request or per concurrent user. Cost depends on how long the underlying compute nodes run, regardless of whether your app is handling traffic.

You pay for nodes, not instances. App Runtime packs multiple instances onto a node when resource requests allow it, so a new node is added only when existing ones are full.

Billing lifecycle

On managed compute, App Runtime billing follows the same lifecycle as SPCS compute pools. For details on how costs accrue in each state (ACTIVE, IDLE, SUSPENDED), see Compute pool cost.

Apps left running while idle still accrue credits. To stop an app you don’t need, see Start, stop, and scale a Snowflake App Runtime app.

On serverless compute, an app accrues credits only while it runs. Snowflake starts the app on the first request and stops it after the idle period set by auto_suspend_secs, so an app with no traffic doesn’t consume compute.

Find App Runtime usage in metering views

App Runtime credits appear in the same metering views that report other Snowflake compute usage:

For cross-account roll-ups, use organization-level metering views such as USAGE_IN_CURRENCY_DAILY.

The following query returns hourly App Runtime credit usage for the last 30 days. Filter service_type to one value to see a single compute type:

SELECT
    start_time,
    end_time,
    service_type,
    credits_used_compute
FROM snowflake.account_usage.metering_history
WHERE service_type IN (
    'SNOWFLAKE_APP_RUNTIME',
    'SNOWFLAKE_APP_RUNTIME_SERVERLESS',
    'SNOWFLAKE_APP_RUNTIME_PREVIEW')
  AND start_time >= DATEADD('day', -30, CURRENT_TIMESTAMP())
ORDER BY start_time DESC;

Find credit usage for each app

Snowflake reports managed compute credits at the account level, so you can’t break them down by app. Apps on serverless compute (Public Preview) report credits for each app.

In METERING_HISTORY, each serverless row has SERVICE_TYPE set to SNOWFLAKE_APP_RUNTIME_SERVERLESS, ENTITY_TYPE set to APPLICATION SERVICE, and ENTITY_ID set to the service’s unique ID. DATABASE_NAME, SCHEMA_NAME, and NAME identify the Application Service.

You can also query SNOWFLAKE_APP_RUNTIME_COMPUTE_HISTORY for hourly serverless credits for each app:

SELECT
  start_time,
  end_time,
  application_service_name,
  credits_used
FROM snowflake.account_usage.snowflake_app_runtime_compute_history
WHERE compute_type = 'SERVERLESS'
  AND start_time >= DATEADD('day', -30, CURRENT_TIMESTAMP())
ORDER BY start_time DESC;

In METERING_HISTORY, group by ENTITY_ID rather than by name. A service that you drop and recreate under the same name gets a new ID, so it counts as a separate app.

To total credits for each app:

SELECT
  entity_id,
  database_name,
  schema_name,
  name AS application_service_name,
  SUM(credits_used) AS credits_used
FROM snowflake.account_usage.metering_history
WHERE service_type = 'SNOWFLAKE_APP_RUNTIME_SERVERLESS'
  AND entity_type = 'APPLICATION SERVICE'
GROUP BY 1, 2, 3, 4
ORDER BY credits_used DESC;

To see daily credit usage for one app over the last 30 days:

SELECT
  DATE_TRUNC('day', start_time) AS usage_date,
  SUM(credits_used) AS credits_used
FROM snowflake.account_usage.metering_history
WHERE service_type = 'SNOWFLAKE_APP_RUNTIME_SERVERLESS'
  AND entity_type = 'APPLICATION SERVICE'
  AND database_name = 'MY_DB'
  AND schema_name = 'MY_SCHEMA'
  AND name = 'MY_APP'
  AND start_time >= DATEADD('day', -30, CURRENT_TIMESTAMP())
GROUP BY 1
ORDER BY 1;

Per-app credits cover serverless compute only. Usage on the managed compute pool isn’t broken down by app, so per-app totals don’t add up to the account’s total App Runtime usage when you use both compute resources.

To query METERING_HISTORY, your role needs access to the SNOWFLAKE.ACCOUNT_USAGE schema, for example through the USAGE_VIEWER database role or IMPORTED PRIVILEGES on the SNOWFLAKE database. See Account Usage.

Usage can take up to three hours to appear in Account Usage views.

Find credit usage for Workspaces preview

When you preview an app in a Snowsight workspace, usage appears in metering views with the service type SNOWFLAKE_APP_RUNTIME_PREVIEW. Each row is attributed to the user who ran the preview, not to an Application Service. See Develop Snowflake App Runtime apps in Snowsight Workspaces.

To see hourly preview credit usage for the last 30 days:

SELECT
  start_time,
  end_time,
  credits_used
FROM snowflake.account_usage.metering_history
WHERE service_type = 'SNOWFLAKE_APP_RUNTIME_PREVIEW'
  AND start_time >= DATEADD('day', -30, CURRENT_TIMESTAMP())
ORDER BY start_time DESC;

To total preview credits for each user, query SNOWFLAKE_APP_RUNTIME_COMPUTE_HISTORY where compute_type is PREVIEW:

SELECT
  user_id,
  SUM(credits_used) AS credits_used
FROM snowflake.account_usage.snowflake_app_runtime_compute_history
WHERE compute_type = 'PREVIEW'
GROUP BY user_id;

To stop a preview before it suspends on its own, select Shutdown from the Preview pane’s menu. Closing the pane leaves the dev server running until it goes idle.

Inspect App Runtime credit usage

For a focused view of App Runtime credit usage, query SNOWFLAKE_APP_RUNTIME_COMPUTE_HISTORY. The view returns hourly credit usage for each compute type over the last 365 days. Use compute_type to tell the rows apart:

  • MANAGED COMPUTE POOL: one row per account per hour.
  • SERVERLESS: one row per Application Service per hour.
  • PREVIEW: one row per user per hour for Workspaces previews.
SELECT
    start_time,
    end_time,
    compute_type,
    credits_used
FROM snowflake.account_usage.snowflake_app_runtime_compute_history
WHERE start_time >= DATEADD('day', -7, CURRENT_TIMESTAMP())
ORDER BY start_time DESC;

Reduce App Runtime cost

On managed compute, an app runs until you suspend or drop it, so a deployed app that nobody uses still consumes compute. To control cost:

Next steps