SNOWFLAKE.ORGANIZATION_USAGE.WAREHOUSE_METERING_HISTORY- Returns hourly credit usage for both Virtual Warehouse credit usage and Cloud Services credit usage per warehouse, for all warehouses in your account. Data is retained for one year.
SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY- Query history with various dimensions, including total elapsed time, warehouse used, data bytes scanned, etc. Data is retained for one year.
SNOWFLAKE.ORGANIZATION_USAGE.USAGE_IN_CURRENCY_DAILY- Returns the daily credit usage and usage in currency format for an organization.
As a best practice, it is suggested you create a schema specifically for the
vantage user. Note, however, that this is optional. See the steps below for details on how to create this schema.Want to query Vantage data inside Snowflake?
This page covers connecting Snowflake so Vantage can ingest Snowflake costs. Snowflake Data Sharing goes the other direction: it gives your Snowflake warehouse read-only SQL access to your Vantage cost data through a Secure Data Share.
Connect Your Snowflake Account
Prerequisites
- You must have a Vantage Organization Owner or Integration Owner role to add or remove this integration. See the Role-Based Access Control documentation for details.
- Create a free Vantage account, then follow the steps below to integrate Snowflake costs.
Snowflake IP Allowed List
If your Snowflake cluster uses an IP allow list for access control, you will need to add the following IPs to that allowed list:Snowflake Schema for Vantage
After creating the below schema, you can add the required views to that schema and grant thevantage user access to the schema.
The below commands are based on the Snowflake documentation.
Copy the code that’s provided under Create Vantage User and Role to Snowflake. This SQL creates a user named
vantage, a role named vantage, and a warehouse named vantage. It also grants the necessary permissions.Vantage automatically generates an RSA public key for you to use when creating the Vantage user and role. You need to copy the code directly from the Vantage integration page to add the RSA key.
Sample of code. Copy directly from Vantage console to get RSA key.
Copy the next code block to set up the Vantage-specific schema to read billing and usage data from your account.
Add the following information to the form:
- Server URL: In the format
<account_identifier>.<region>.snowflakecomputing.com. - Database: The name of the database the usage views are in (e.g.,
vantage). - Schema: The name of the schema the usage views are in (e.g.,
public). - Username set for the
vantageuser.
As soon as costs are processed, they will be available on your All Resources Cost Report. If you decide to remove your Snowflake integration from Vantage, all costs associated with your Snowflake integration will be removed from the Vantage console.
Next Steps - Manage Workspace Access
Once the import is complete and the integration status changes to Stable, you can select which workspaces this integration is associated with. See the Workspaces documentation for information.Rotate Snowflake RSA Keys
You can rotate the RSA key pair for an existing Snowflake integration from the Vantage console. This lets you add and test a secondary key before replacing the primary key that Vantage uses to connect to Snowflake. Before you begin, make sure you have permission to manage integrations in Vantage and a Snowflake role that can runALTER USER for the Snowflake user configured on the Vantage integration.
Copy the SQL commands directly from your Vantage console. The examples below show the shape of each command, but Vantage generates keys that are unique to each Snowflake connection.
In Vantage, navigate to your Snowflake integration:
- From the top navigation, click Settings.
- On the left navigation, select Integrations and select Snowflake.
- Click the Snowflake connection you want to rotate.
In the Secondary Keys section, click Create Secondary Key Set. Vantage creates a new secondary RSA key pair and displays a Key Rotation checklist.
Copy the first generated SQL command from Vantage and run it in Snowflake. This adds the new public key as the user’s secondary public key.If your Vantage integration uses a Snowflake username other than
vantage, use the username shown in the Vantage-generated command.In Vantage, click Test Connection to verify that the secondary key works. The connection test may take a few minutes. Wait for it to complete before continuing.When the test succeeds, Vantage refreshes the page and enables Promote Secondary Keys. If the test fails, leave the primary key unchanged and follow the troubleshooting guidance below.
Copy the next generated SQL command from Vantage and run it in Snowflake. This makes the validated secondary key the primary public key in Snowflake.
Copy the generated cleanup command from Vantage and run it in Snowflake. This removes the secondary public key from the Snowflake user.
If you click Create Secondary Key Set again before promotion, Vantage replaces the previous unpromoted secondary key set. Run the latest SQL commands shown in the console.
Data Refresh
See the provider data refresh documentation for information on when data for each provider refreshes in Vantage.View Snowflake Metrics on Cost Reports
You can import Snowflake SQL query results as business metrics to view alongside Cost Reports. Snowflake business metric imports reuse a connected Snowflake integration, but the configured Snowflake role must haveSELECT access to the metric tables or views referenced in your query. See the Unit Costs documentation for more information.
Troubleshoot Snowflake Errors
Common integration errors are described below.Promote Secondary Keys Is Disabled
The Promote Secondary Keys button is disabled until the secondary key passes the Vantage connection test. Complete the Test Connection step first. The test may take a few minutes; while it is running, Vantage shows a progress indicator and waits for the result. If the test times out, click Test Connection again. If it continues to time out, confirm that Snowflake is reachable from the Vantage IPs in the Snowflake IP Allowed List, then contact support@vantage.sh for assistance.Snowflake Rejected the Secondary Key
If the Vantage connection test returnsSnowflake rejected the secondary key., Snowflake rejected authentication with the secondary RSA key. The most common causes are:
- The generated
RSA_PUBLIC_KEY_2command was not run in Snowflake. - The public key was copied incompletely or modified before being pasted into Snowflake.
- The command was run for a different Snowflake user than the one configured in Vantage.
- The command was run in a different Snowflake account than the one connected to Vantage.
- A Snowflake network policy is blocking Vantage.
Confirm your Snowflake network policy allows the Vantage IPs listed in the Snowflake IP Allowed List.
Connection Fails After Promoting Keys
If the Snowflake connection fails after you promote secondary keys in Vantage, confirm that you first ran the generatedALTER USER ... SET RSA_PUBLIC_KEY='...' command in Snowflake. Vantage should only be promoted after Snowflake’s primary public key has been updated to the new key.
If Snowflake was not updated first, create a new secondary key set in Vantage and repeat the key rotation process using the latest generated SQL commands.
query_history Column Count Mismatch
Snowflake occasionally makes changes to the queries/tables that get used for cost and usage attribution, causing the views in Vantage to then be based on an old query. You may see an error in the Vantage console, similar to the below error:
Vantage views in Snowflake and ensure the vantage user is granted permission on those views.
After you’ve completed the below steps, contact support@vantage.sh to reimport your Snowflake data.
Invalid username or password Error
If your Snowflake integration shows an Invalid username or password error in the Vantage console, the cause is almost always a username or RSA public key issue, not a password issue.
Snowflake returns the Invalid username or password message for several underlying authentication failures, including:
JWT_TOKEN_INVALID_PUBLIC_KEY_FINGERPRINT_MISMATCH— the RSA public key configured in Snowflake does not match the public key generated by Vantage.INCOMING_REQUEST_BLOCKED— Snowflake rejected the signed JWT, typically due to a key mismatch or a network policy.- A
vantageuser that does not exist in your Snowflake account.
- The public key was manually modified in Snowflake.
- The integration was recreated in Vantage, generating a new public key.
- The public key was incorrectly copied during initial setup.
Navigate to your Snowflake integration in Vantage:
- From the top navigation, click Settings
- On the left navigation, select Integrations and select Snowflake
- Click on your Snowflake connection to open the Manage Connection page
Copy the Primary Public Key from the Vantage console. This is the RSA public key that Vantage generated for your integration.
In Snowflake, update the Replace
vantage user’s RSA public key to match the one from Vantage:{YOUR_RSA_KEY_GENERATED_BY_VANTAGE} with the exact public key copied from the Vantage console.The public key must match exactly between Vantage and Snowflake. Ensure you copy the entire key from the Vantage console without any modifications or extra characters.
Snowflake Reporting Dimensions
On Snowflake Cost Reports, you can filter across several dimensions:- Account (account name)
- Category (e.g., Data Cloud Data Transfer)
- Metadata (e.g.,
environment is staging) - Region (e.g., AWS EU West 1)
- Organization (organization name)
- Service (e.g., Data Cloud)
- Tags: Includes Virtual Tags created in Vantage for this provider. The following tags are also available for filtering and grouping. These are derived from columns in the Snowflake usage views Vantage reads (e.g.,
QUERY_HISTORY), not from Snowflake object tags.user: The user who ran the query (fromUSER_NAME), allowing you to filter and group costs by user.warehouse: The warehouse name (fromWAREHOUSE_NAME), allowing you to filter and group costs by warehouse.role: The role name when present (fromROLE_NAME), allowing you to filter and group costs by role.query_tag: The session query tag when present (from theQUERY_TAGcolumn in query history). This can be a single value or, if set as JSON (e.g.,ALTER SESSION SET query_tag = '{"team":"eng"}'), parsed into tag key/value pairs for filtering and grouping.
- Charge Type (e.g., Usage)