Skip to main content

Snowflake

Vantage integrates with your Snowflake account through a secure, read-only user that has access to Snowflake usage tables. Optionally, you can create a specific schema for the Vantage user.

Vantage requires read-only access to the following tables:

note

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.

Connect Your Snowflake Account

Prerequisites

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:

54.87.66.45
3.95.43.133
54.162.3.72
44.199.143.63
3.218.103.23

Snowflake Schema for Vantage

After creating the below schema, you can add only the needed views to that schema and grant the vantage user access to the schema.

info

The below commands are based on the Snowflake documentation.

  1. In Snowflake, create a user named vantage, a role named vantage, and a warehouse named vantage. Grant the necessary permissions. Ensure you replace the password placeholder with a strong password for the vantage user.

    use role accountadmin;
    create database vantage;
    create role vantage;
    create user vantage;
    grant role vantage to user vantage;
    grant role vantage to role accountadmin;
    create warehouse vantage;
    grant all on warehouse vantage to role vantage;
    alter user vantage set DEFAULT_WAREHOUSE=vantage, DEFAULT_ROLE=vantage;
    alter user vantage set password='<A STRONG PASSWORD>';
  2. Set up the Vantage-specific schema to read billing and usage data from your account.

    use warehouse vantage;
    create view VANTAGE.PUBLIC.QUERY_HISTORY as select * from SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY;
    create view VANTAGE.PUBLIC.WAREHOUSE_METERING_HISTORY as select * from SNOWFLAKE.ORGANIZATION_USAGE.WAREHOUSE_METERING_HISTORY;
    create view VANTAGE.PUBLIC.USAGE_IN_CURRENCY_DAILY as select * from SNOWFLAKE.ORGANIZATION_USAGE.USAGE_IN_CURRENCY_DAILY;
    grant usage on schema vantage.public to role vantage;
    grant usage on database vantage to role vantage;
    grant select on all views in schema VANTAGE.PUBLIC to role vantage;
  3. Test your setup.

    use role vantage;
    select * from vantage.public.query_history limit 1;
  4. Navigate to the Snowflake Settings page in the Vantage console to add a new Snowflake connection. Then, click Add Connection.

  5. 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 and Password set for the vantage user.
  6. Click Connect Account. The status of your account will change to Importing.

Costs will be ingested and processed immediately, but it may take several hours to populate all Vantage tools depending on the query volume of your warehouse. Vantage will refresh at least once daily for Snowflake.

Troubleshoot Snowflake Errors

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:

View definition for 'VANTAGE.PUBLIC.QUERY_HISTORY' declared 66 column(s), but view query produces 77 column(s).

To fix the issue, replace the three Vantage views in Snowflake and ensure the vantage user is granted permission on those views.

note

After you've completed the below steps, contact support@vantage.sh to reimport your Snowflake data.

USE WAREHOUSE vantage;
CREATE OR REPLACE VIEW VANTAGE.PUBLIC.QUERY_HISTORY as select * from SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY;
CREATE OR REPLACE VIEW VANTAGE.PUBLIC.WAREHOUSE_METERING_HISTORY as select * from SNOWFLAKE.ORGANIZATION_USAGE.WAREHOUSE_METERING_HISTORY;
CREATE OR REPLACE VIEW VANTAGE.PUBLIC.USAGE_IN_CURRENCY_DAILY as select * from SNOWFLAKE.ORGANIZATION_USAGE.USAGE_IN_CURRENCY_DAILY;
GRANT USAGE ON SCHEMA vantage.public TO ROLE vantage;
GRANT USAGE ON DATABASE vantage TO ROLE vantage;
GRANT SELECT ON ALL VIEWS IN SCHEMA vantage.public TO ROLE vantage;

Snowflake Reporting Dimensions

On Snowflake Cost Reports, you can filter across several dimensions:

  • Account
  • Category
  • Metadata
  • Region
  • Organization
  • Service

Active Resources

Snowflake queries are synced as active resources and available in resource reports.

Manage Workspace Access

See the Workspaces documentation for information on how to update workspace access for an integration.