Managing Snowflake Accounts
Spendview for Snowflake is a free module from DataOps.live observability, a core component of our platform.
Managing accounts
The free module Spendview for Snowflake supports managing Snowflake accounts as data sources to be monitored.
Prerequisites
- You can access Snowflake as a new user with the role
DATAOPS_OBS_VIEWER
, which has the necessary permissions. See Create user and warehouse for more information. - If a firewall protects your Snowflake account, you must add our IPs to the allowlist to enable access to your account:
35.176.116.33
,3.11.127.149
, and18.170.83.22
.
Add an account
Open Spendview for Snowflake in your browser and sign in.
On the sidebar, click the Snowflake Accounts icon.
Click Add Account on the top right to open a form.
Enter your Snowflake account name. To get the account name:
Log in to Snowflake.
Click the dropdown arrow next to the Snowflake icon on the bottom left and, in the open list, select the account you want to monitor.
Click the copy icon next to the account.
Enter the copied account in the form and replace
.
with-
.For example,
oalsots.ot18677
becomesoalsots-ot18677
.You can get the current Snowflake account name from the address in your browser — the text immediately following the two forward slashes:
Enter a username, a password, and a warehouse name. You can use an existing user and warehouse or create new ones.
As an account user, you must have a default role with at least the permissions
USAGE_VIEWER
andGOVERNANCE_VIEWER
on the Snowflake database. Learn more about creating a new user with the proper permissions using a script.What you enter in the warehouse field will be the observability login user's default warehouse and should match the Snowflake user's default warehouse. Learn more about creating a new warehouse using a script.
We recommend you use an existing warehouse frequently used by you as the queries triggered by the platform are relatively small. They will not increase your expenses significantly if they run on a warehouse used by other users.
Click Submit to add the Snowflake account.
Repeat the above steps to add all the Snowflake accounts you want to monitor.
Edit an account
Open Spendview for Snowflake in your browser and sign in.
On the sidebar, click the Snowflake Accounts icon.
On the tile of the account you want to modify, Click Edit.
Modify the values in the account fields as necessary, including entering a new password, and click Save.
To switch to the account cost view, click the dollar sign on the top right of the tile.
The cost per credit and Terabyte are added by default. Check these values and change them if your Snowflake billing is different.
Click Edit, modify the cost per credit and TB if needed, and click Save.
Create user and warehouse
Find below two scripts that can help you create a new user with the necessary permissions and the warehouse necessary to use Spendview for Snowflake.
Use the following script to create the user
DATAOPS_OBS
with the user roleDATAOPS_OBS_VIEWER
that has the necessary permissions. You can change the user name and role or use an existing user after adding the relevant database roles. Only a user with theACCOUNTADMIN
role can run this script.-- with the ACCOUNTADMIN role, execute the following script:
USE ROLE ACCOUNTADMIN;
-- DATAOPS_OBS_VIEWER is the name of the role you may replace with any other name.
CREATE ROLE DATAOPS_OBS_VIEWER;
USE DATABASE SNOWFLAKE;
-- https://docs.snowflake.com/en/sql-reference/snowflake-db-roles.html
GRANT DATABASE ROLE USAGE_VIEWER TO ROLE DATAOPS_OBS_VIEWER;
GRANT DATABASE ROLE GOVERNANCE_VIEWER TO ROLE DATAOPS_OBS_VIEWER;
-- Create a user for Spendview for Snowflake (optional). You can use an existing one.
CREATE USER IF NOT EXISTS DATAOPS_OBS
password = 'enter your password';
--DATAOPS_OBS, the user that will be used for Spendview for Snowflake.
GRANT ROLE DATAOPS_OBS_VIEWER TO USER DATAOPS_OBS;
ALTER USER DATAOPS_OBS
SET default_role = DATAOPS_OBS_VIEWERUse the following script to create a new warehouse called
DATAOPS_OBS_WH
:-- create a warehouse for Spendview for Snowflake (optional). You can use an existing one.
CREATE WAREHOUSE IF NOT EXISTS DATAOPS_OBS_WH
warehouse_size = 'Small'
AUTO_SUSPEND = 30 ;
-- For a better user experience, we recommend the size to be at least Small.
-- If you already have a warehouse in use with a larger size, like Medium,
-- we recommend using it as the platform will be faster.
-- If the warehouse is only for Spendview for Snowflake, we strongly recommend
-- setting a low AUTO_SUSPEND value, like 20-30 sec. The queries generated by
-- the platform are fast, 5 sec per run, so we would like to suspend the
-- warehouse when there is no traffic. There is no point in having an
-- AUTO_SUSPEND less than 30 sec as billing is per second (with a 60-second
-- minimum each time the warehouse starts).
GRANT ALL PRIVILEGES
ON WAREHOUSE DATAOPS_OBS_WH
TO ROLE DATAOPS_OBS_VIEWER;
ALTER USER DATAOPS_OBS
SET default_warehouse = 'DATAOPS_OBS_WH';