Partajați prin


Monitor default storage costs

This article explains how to use the billable usage system table to monitor the cost of your default storage usage.

How default storage usage is measured

You are charged for default storage based on both the storage space used and the API operations performed on the data. Both of these usage types are measured in DSUs. For specific pricing information, see Default storage pricing.

Understanding default storage usage records

You can track and attribute usage of default storage by querying the billable usage system table (system.billing.usage).

The following table describes the key columns and metadata fields for default storage usage records:

Column Values
billing_origin_product DEFAULT_STORAGE
usage_type The type of default storage usage. Possible values are:
  • STORAGE_SPACE: Costs associated with storing data in default storage. Related to the volume of data stored.
  • API_OPERATION: Costs associated with API-level requests on default storage data such as reads, writes, and listing operations.
usage_metadata.metastore_id The ID of the metastore associated with the default storage usage
usage_metadata.catalog_id The ID of the catalog associated with the default storage usage. Default storage usage is aggregated at the catalog level.
usage_metadata.storage_api_type Only populated for default storage API operation usage. Otherwise null. Possible values are:
  • TIER_1: PUT, COPY, POST, LIST operations
  • TIER_2: Other API operations

For more information on reading the usage table, see Billable usage system table reference.

Track monthly storage usage by catalog

The following query returns monthly usage by default storage space, aggregated by catalog:

SELECT
  usage_metadata.metastore_id,
  usage_metadata.catalog_id,
  DATE_TRUNC('month', usage_date) AS month,
  SUM(usage_quantity) AS dsu
FROM system.billing.usage
WHERE billing_origin_product = 'DEFAULT_STORAGE'
  AND usage_type = 'STORAGE_SPACE'
GROUP BY 1, 2, 3
ORDER BY month DESC;

Track monthly API operations usage by catalog

The following query returns monthly usage by API operations on default storage, aggregated by catalog:

SELECT
  usage_metadata.metastore_id,
  usage_metadata.catalog_id,
  usage_metadata.storage_api_type,
  DATE_TRUNC('month', usage_date) AS month,
  SUM(usage_quantity) AS dsu
FROM system.billing.usage
WHERE billing_origin_product = 'DEFAULT_STORAGE'
  AND usage_type = 'API_OPERATION'
GROUP BY 1, 2, 3, 4
ORDER BY month DESC;