Work with Snowflake data
Once you've imported your Snowflake data into the DoiT platform, you can start using Cloud Analytics and other DoiT features such as Budgets, Allocations, and Anomaly detection to analyze and monitor your Snowflake cost and usage.
Snowflake data in Cloud Analytics
Standard dimensions
You can get Snowflake data through the standard Cloud Analytics dimensions. See below for the mapping between the DoiT Cloud Analytics and Snowflake terminologies:
| DoiT term | Snowflake term | Snowflake definition |
|---|---|---|
| Billing account ID | ORGANIZATION_NAME | The name of the organization. |
| Cost | USAGE_IN_CURRENCY | The total amount charged for the USAGE_TYPE for USAGE on the USAGE_DATE. |
| Cost type | BALANCE_SOURCE | The source of the funds used to pay for the daily usage. See possible values of BALANCE_SOURCE. |
| Project ID | ACCOUNT_NAME | The name of the account where the usage occurs. |
| Service ID | SERVICE_TYPE | The type of usage. See possible values of SERVICE_TYPE. |
| SKU | RATING_TYPE | Indicates how the usage in the record is rated or priced. Possible values: compute, data_transfer, storage, other. |
| Unit | USAGE | The total amount of usage charged based on SERVICE_TYPE. |
| Usage | BILLING_TYPE | Indicates what is being charged or credited. See possible values of BILLING_TYPE. |
Possible values of BALANCE_SOURCE
-
capacity: Usage paid with credits remaining on an organization's capacity commitment. -
free usage: Usage covered by the free credits provided to the organization. -
overage: Usage that was paid at on-demand pricing, which occurs when an organization has exhausted its capacity, rollover, and free credits. -
rebate: Usage covered by the credits awarded to the organization when it shared data with another organization. -
rollover: Usage paid with rollover credits. When an organization renews a capacity commitment, unused credits are added to the balance of the new contract as rollover credits.
Possible values of SERVICE_TYPE
-
ai_functions: Refers to Cortex AI Functions such as AI_COMPLETE, AI_TRANSLATE, and SUMMARIZE. See Cortex AI cost attribution. -
automatic_clustering: Refers to automatic clustering. -
cloud_services: Refers to cloud service credit usage. -
cortex_agents: Refers to Cortex Agents. See Cortex AI cost attribution. -
cortex_search: Refers to Cortex Search services. See Cortex AI cost attribution. -
data_transfer: Refers to Understanding data transfer cost. -
logging: Refers to Logging and Tracing Overview. -
materialized_view: Refers to Working with Materialized Views. -
query_acceleration: Refers to Using the Query Acceleration Service. -
replication: Refers to Introduction to replication and failover across multiple accounts. -
search_optimization: Refers to Search Optimization Service. -
serverless_task: Refers to Introduction to tasks. -
snowflake_intelligence: Refers to Snowflake Intelligence, a conversational assistant for data analysis. -
snowpipe: Refers to Snowpipe. -
snowpipe_streaming: Refers to Snowpipe Streaming. -
storage: Refers to Understanding storage cost. -
warehouse_metering: Refers to Virtual warehouse credit usage. Does not indicate usage of serverless or cloud services compute.
Other Cortex and AI-related service types may appear in your billing data as Snowflake expands its AI capabilities. DoiT flags only recognized direct inference, agent, and AI coding service types as GenAI spend. Deprecated ai_services and other mixed or infrastructure service types remain unclassified.
Possible values of BILLING_TYPE
-
consumption: Usage associated with compute credits, storage costs, and data transfer costs. -
priority support: Charges for priority support services. This charge is associated with a stipulation in a contract, not with an account. -
rebate: Usage covered by the credits awarded to the organization when it shared data with another organization. -
support_credit: Snowflake Support credited the account to reverse charges attributed to an issue in Snowflake. -
vps_deployment_fee: Charges for a Virtual Private Snowflake deployment.
System labels
Below are the Snowflake system labels that you can use in Cloud Analytics.
-
genai/genai_spend: Indicates direct foundation-model inference, agent, or AI coding spend. Deprecated
AI_SERVICES, Cortex Search, guardrails, tools, document processing, fine-tuning, and provisioned throughput are not classified as GenAI spend. -
genai/model and genai/model_family: The model and normalized family reported by canonical Snowflake AI telemetry.
-
genai/usage_type and genai/pricing_unit: The token direction and unit reported for AI usage.
-
genai/inference_region: The region routing reported for Cortex REST API inference.
-
genai/user_id, genai/user_name, and genai/user_email: The calling user. Cortex Agents telemetry can provide the user name directly. Email enrichment, and name resolution for sources that provide only a user ID, require the
SNOWFLAKE.SECURITY_VIEWERdatabase role. The user ID is never substituted for the name. -
snowflake/cortex_function, snowflake/cortex_agent, and snowflake/cortex_agent_service_type: The Snowflake AI SQL function or Cortex Agent workload associated with attributed usage.
GenAI Spend includes the recognized AI_FUNCTIONS, AI_INFERENCE, AI_INFERENCE_DEPRECATED, CORTEX_AGENTS, SNOWFLAKE_INTELLIGENCE, SNOWFLAKE_COWORK, Cortex Code, and Snowflake CoCo service types. DoiT uses CORTEX_AI_FUNCTIONS_USAGE_HISTORY to allocate credit-based AI SQL costs. Input and output token counts appear as zero-cost usage details because Snowflake reports function-call credits as a total rather than by token type. Cortex REST API telemetry has no request-level cost, so AI_INFERENCE model, user, region, and token details are also emitted as zero-cost usage rows while the aggregate billing row retains the authoritative cost.
Historical enrichment is limited by the retention of Snowflake's canonical Cortex usage views. If telemetry is unavailable for an older billing period, DoiT keeps the original billing row and cost without inferring model, token, or user details from an overlapping or deprecated view.
-
snowflake/database_id: The ID of a Snowflake database.
-
snowflake/database_name: The name of a Snowflake database.
-
snowflake/query_hash: A cryptographic hash of the query text, used for identification and grouping. See Query cost.
-
snowflake/query_parameterized_hash: A cryptographic hash of the query text after parameterization, used for identification and grouping. See Query cost.
-
snowflake/service_level: The level of service associated with the Snowflake warehouse, such as Standard or Enterprise.
-
snowflake/user_name: The name of the user who executed the query.
-
snowflake/warehouse_credit_cloud_services_rate: The cost per warehouse credit for cloud services, such as storage or networking.
-
snowflake/warehouse_credit_compute_rate: The cost per warehouse credit for compute resources.
-
snowflake/warehouse_id: The ID of a Snowflake warehouse.
-
snowflake/warehouse_name: The name of a Snowflake warehouse.
Cortex AI labels
The following system labels appear on Snowflake Cortex AI billing rows. For more details on what these labels describe, see Cortex AI cost attribution.
-
genai/coding_agent: Set to
truefor Cortex Code service types (cortex_code_*). -
genai/genai_spend: Set to
truefor all Cortex and AI-related service types. Use this label to filter for GenAI spend across providers. This is the same flag used by GenAI Intelligence. -
genai/model: The name of the AI model used (for example,
claude-3-5-sonnet,llama3.1-70b). Available onai_functionsrows andcortex_searchrows with theembed_text_tokensusage type. -
genai/model_family: The model family (for example,
Claude,Meta Llama,Mistral). Available onai_functionsrows andcortex_searchrows with theembed_text_tokensusage type. -
genai/pricing_unit: The unit of measurement for the consumption metric (for example,
tokens,pages). Available onai_functionsrows andcortex_searchrows with theembed_text_tokensusage type. -
genai/usage_type: The type of consumption within a Cortex service (for example,
input,output, ortotalfor AI Functions, andserving,embed_text_tokens, orbatchfor Cortex Search). -
genai/user_email: The email address of the Snowflake user who initiated the request. Available on
ai_functionsandcortex_agentsrows and requires theSECURITY_VIEWERgrant. See Connect Snowflake. -
genai/user_id: The numeric Snowflake user ID that initiated the request. Available on
ai_functionsandcortex_agentsrows. -
genai/user_name: The name of the Snowflake user who initiated the request. Available on
ai_functionsandcortex_agentsrows. Without theSECURITY_VIEWERgrant, AI Functions rows fall back to the numeric user ID; Cortex Agents rows retain the user name reported by Snowflake. -
snowflake/cortex_agent: The fully qualified name of the Cortex Agent (for example,
MY_DB.MY_SCHEMA.MY_AGENT). Available oncortex_agentsrows. -
snowflake/cortex_function: The Cortex AI function that was called (for example,
AI_COMPLETE,AI_TRANSLATE). Available onai_functionsrows. -
snowflake/cortex_search_service: The fully qualified name of the Cortex Search service. Available on
cortex_searchrows.
QUERY_TAG
DoiT supports Snowflake's QUERY_TAG. Such tags appear under Labels & Tags in Cloud Analytics reports.
Extended metrics
GenAI Units
The GenAI Units metric records token usage from Snowflake's canonical AI usage views. For Cortex REST API inference, these usage-only detail rows have zero cost; the authoritative cost remains on the aggregate AI_INFERENCE row.
Query Cost
The Query Cost metric quantifies an estimate for the amount of resources consumed by a specific query in the Snowflake warehouse. It estimates the computational expense associated with executing a query based on its runtime.
Compute cost is split proportionally against all queries that run against that warehouse, based on their timeshare of the warehouse uptime. For example, if a query runs for 15 seconds over a full hour of warehouse availability, it's recorded as consuming the equivalent of the full hour of compute resources. If the warehouse remains idle for an hour without any active queries, there will be no associated compute costs.
The Query Cost metric is intended solely for profiling queries and understanding resource usage. It does not directly translate into actual costs incurred and should not be used as a financial metric.
To configure this in a report, you can group by resource ID to see which queries were executed on a specific resource. This identifies the Snowflake query ID, which you can then use to track those queries in Snowflake. If a query is executed multiple times, you can track how much those repeated queries contribute to overall costs.
In addition, the following dimensions are available to help you identify identical or similar queries, even if they have different values.
-
snowflake/query_hash: generated based on the query text. If the same query is run multiple times with different values, it will still have the same
query_hash. See Using the Hash of the Query (query_hash). -
snowflake/query_parameterized_hash: generated after specific values are replaced with placeholders. If the same query is run multiple times with different values, it will still have the same
query_parameterized_hash. See Using the Hash of the Parameterterized Query (query_parameterized_hash).
See Query cost for an example application of this metric.
GenAI Units
The GenAI Units metric reports the number of tokens (or other units such as pages) consumed by Cortex AI operations. It is available on billing rows for ai_functions, cortex_agents, and cortex_search service types. For Cortex Search, Snowflake reports token counts only for the embed_text_tokens usage type; serving and batch rows don't include token counts.
Use this metric to understand token-level consumption patterns across models, agents, and search services independently of cost. For example, you can group by genai/model to compare token usage across different models, or by genai/user_name to identify which users consume the most tokens.
Cortex AI cost attribution
DoiT breaks down aggregate Snowflake Cortex billing rows into detailed rows attributed to individual models, functions, agents, search services, and users. This gives you granular visibility into which AI workloads are driving Cortex costs.
Attribution is available for three Cortex service types:
-
AI Functions (
ai_functions): Cost is split across each model and function combination (for example,claude-3-5-sonnetviaAI_COMPLETE), with per-user and per-warehouse attribution. Token counts are reported as GenAI Units. -
Cortex Agents (
cortex_agents): Cost is split across each agent and user combination. Token counts are reported as GenAI Units. -
Cortex Search (
cortex_search): Cost is split across each search service and consumption type (such asservingorembed_text_tokens), with model attribution where applicable.
Other Cortex and AI service types (such as snowflake_intelligence) appear as aggregate billing rows flagged with genai/genai_spend = true but without per-model or per-user breakdown.
Cortex AI attribution requires the USAGE_VIEWER database role. Resolving user names on AI Functions rows and adding email addresses to AI Functions and Cortex Agents rows additionally requires the SECURITY_VIEWER database role. See Connect Snowflake for details.
Example reports
This section provides example reports that demonstrate how to work with Snowflake data in Cloud Analytics. You can combine the stand dimensions and metrics with Snowflake query tags to create reports.
Overall cloud spend
This example shows an organization's cloud costs in the last few months.
- Group by: Provider

DOIT_WAREHOUSE cost
This example shows the costs in the last few months incurred by the DOIT_WAREHOUSE, a warehouse created by DoiT on your behalf.
-
Group by: snowflake/warehouse_name
-
Filters: snowflake/warehouse_name equals
DOIT_WAREHOUSE

Query cost
This example shows the top 10 daily query costs for the last month.
-
Metric: Query Cost
-
Filters
- Provider:
Snowflake - Service:
WAREHOUSE_METERING
- Provider:
-
Group by:
Resource -
Limit results:
limit by top/bottom
