All Collections
For Developers
Integrate with Snowflake
Integrate with Snowflake
Updated over a week ago

When you connect Panobi with your data in Snowflake, you’ll be able to see your team’s work side-by-side with the impact it’s making on your most important metrics.

Connecting Snowflake lets you...

  • see the effect of each project on your core business metrics like activation rate or DAU/MAU

  • contextualize metrics with concurrent real-world events like marketing campaigns and holidays

  • share consistent updates across your company

How to connect Snowflake with Panobi

These steps can also be found in your Panobi Integration Settings, if you have not yet configured this integration):

  1. Locate the data to share with Panobi
    Decide which tables you want to permit Panobi to access and figure out the relevant warehouses, databases, and schemas. You’ll need this information plus Snowflake admin privileges in order to complete the following steps.

  2. Create a new read-only role

    • Log in to your account at https://app.snowflake.com/.

    • Click on “Worksheets” in the left navigation, and then click the plus-sign button in the top right to start a new SQL worksheet.

    • Copy the code below and paste it in the new worksheet.

    • Edit <role name> with whatever you’d like to call the role (be sure to remove the angle brackets) — we suggest using “Panobi” or something similar.

    • Click the blue Play button in the top right to execute this first command.

      -- Create a read-only role with privileges to allow Panobi access to the correct data. Choose a role name.


      CREATE ROLE IF NOT EXISTS <role name>;

  3. Grant USAGE permissions to the role

    • Copy the code below and paste it in the worksheet.

    • Removing angle brackets, replace the generic names with your chosen warehouse, database, and schema that house the desired tables (do this for the role name, as well).

    • Repeat lines 2-4 if you need to grant Panobi permission to more than one warehouse, database, or schema.

    • Click the other blue button, to the right of the Play symbol, and select “Run all” to execute this group of commands.

      -- Grant USAGE permissions to the role for access to at least one warehouse, database, and schema.


      GRANT USAGE ON WAREHOUSE <warehouse name> TO ROLE <role name>;

      GRANT USAGE ON DATABASE <database name> TO ROLE <role name>;

      GRANT USAGE ON SCHEMA <schema name> TO ROLE <role name>;

  4. Grant SELECT permissions to the role

    • You can grant SELECT permissions on all current tables, on all future tables, or only on specific tables (copy the relevant lines below and edit as necessary, remembering to remove the angle brackets).

    • Repeat line 6 if you need to grant SELECT on multiple specific tables.

    • Again, click the other blue button, to the right of the Play symbol, and select “Run all”.

      -- to grant SELECT on all tables that currently exist:


      GRANT SELECT ON ALL TABLES IN SCHEMA <database name>.<schema name> TO ROLE <role name>;


      -- to grant SELECT on tables created in the future:


      GRANT SELECT ON FUTURE TABLES IN SCHEMA <database name>.<schema name> TO ROLE <role name>;


      -- to grant SELECT only on a specific table:

      
GRANT SELECT ON <database name>.<schema name>.<table name> TO ROLE <role name>;

  5. Create a new user and assign them the role

    • Click on the back arrow in the top left to return to the main navigation, choose “Admin”, followed by “Users & Roles” in the sub-menus.

    • In the top right, click the “+ User” button, and give this new user a username, an email address, and a password (we suggest “Panobi_user” for the username).

    • Uncheck the "Force user to change password on first time login" checkbox.

    • Open the “Advanced User Options”, and choose your newly created role from the Default Role dropdown.

    • Click “Create User”.

  6. If necessary, create a network rule and update your network policy
    If your organization has implemented a Snowflake Network Policy as an added security layer, you'll need to modify it so that Panobi is permitted to query the service. Skip to Step 7 if this doesn't apply to you. Otherwise, here's what to do:

    • In Snowflake, use the navigation on the left to navigate to the "Admin" section and then the subsection "Security".

    • In the "Security" section, you should be on the "Network Policies" tab.

    • Select the relevant policy, and click the three dots menu to edit it.

    • In the modal that appears, click "New rule" to create a new network rule. Name your network rule something like "Panobi integration." Select the database / schema you'd like to query via Panobi, then choose the type "IPv4" and the mode "Ingress" from the respective dropdowns. In the IP address field, paste this address: 35.238.161.148/32

    • Click "Create Network Rule".

    • Next, from the "Select rule" dropdown, choose your newly created Panobi integration rule. Mark it as "allowed" with the toggle, and click on "Update Network Policy".

  7. Enter your account and user credentials in Panobi Settings

    • To find your Snowflake account URL, click on “Accounts” in the “Admin” menu. Copy the correct URL by hovering over the relevant account and clicking on the link icon that appears.

    • In Panobi, navigate to your Settings, click on "Integrations", and choose Snowflake from the list of available integrations. Open the Configuration tab and find the input fields for Account URL, Username, and Password (you may need to scroll).

    • Enter the relevant information into those fields and click "Connect".


How to add a Snowflake metric

Click + Add metric on the Metrics page and select Snowflake from the data source dropdown. Then, paste the SQL query into the window, check that the correct columns of data have been returned, and choose the appropriate visualization.

Only metrics configured as a time series chart will be available on your timeline. This is how you should represent your KPI and OKR-level metrics such as “rate of activation” “new users” or “DAU”. You can also include other metrics you’re tracking, such as any baseline health indicators.

After creating your key metrics in Panobi, you can reference them quickly in any project or insight by typing # and typing to find the metric title. Remember to include information like which team or teams own the metric, the individual collaborators who contributed to the analysis, and any appropriate tags that will help someone find this metric in the future.

Troubleshooting

If you run into any issues integrating your Panobi workspace with Snowflake, check out our troubleshooting article.

Did this answer your question?