back to catalog
OtherTML
works in free trial | Built on 8.1.0.cl

Snowflake Performance & Consumption Get code

Code by ThoughtSpot

Worksheets

  • Query History
  • Stage Analysis
  • Database Storage History
  • Storage Usage
  • Warehouse Metering History

Liveboards

  • Snowflake Query Volume: are queries TS Index queries, queued, using cloud services?
  • Snowflake Query Performance: what is the latency of queries?
  • Snowflake Query Credit Costs: identify potentially expensive queries?
  • Snowflake Stages: meta data information for stages? I.e. owners, databases.
  • Snowflake Storage: how is storage being consumed and estimated costs?
  • Snowflake Warehouse Consumption: which warehouses are consuming credits?

Rate this code

Thank you for rating this code!

Installation instructions

Snowflake Set Up Instructions

By default, Snowflake.Account_Usage is limited to the role ACCOUNTADMIN Grant permission for the following views to role defined in Embrace Connection

  • DATABASESTORAGEUSAGE_HISTORY
  • QUERY_HISTORY
  • STAGES
  • STORAGE_USAGE
  • WAREHOUSEMETERINGHISTORY

Snowflake Grant Role Example

Change EXAMPLE_Role to role of your choosing.

GRANT Usage to Embrace User

GRANT USAGE ON DATABASE "SNOWFLAKE" TO ROLE PMM_ROLE; GRANT USAGE ON SCHEMA "SNOWFLAKE"."ACCOUNT_USAGE" TO ROLE PMM_ROLE; GRANT SELECT ON DATABASE_STORAGE_USAGE_HISTORY IN SCHEMA "SNOWFLAKE"."ACCOUNT_USAGE" TO ROLE PMM_ROLE;

GRANT SELECT ON QUERYHISTORY IN SCHEMA "SNOWFLAKE"."ACCOUNTUSAGE" TO ROLE PMM_ROLE

GRANT SELECT ON STAGES IN SCHEMA "SNOWFLAKE"."ACCOUNT_USAGE" TO ROLE PMM_ROLE; GRANT SELECT ON STORAGE_USAGE IN SCHEMA "SNOWFLAKE"."ACCOUNT_USAGE" TO ROLE PMM_ROLE; GRANT SELECT ON WAREHOUSE_METERING_HISTORY IN SCHEMA "SNOWFLAKE"."ACCOUNT_USAGE" TO ROLE PMM_ROLE;

Replicate the QUERY_HISTORY to a local table for Performance

GRANT USAGE ON DATABASE "SNOWFLAKE_USAGE_TS" TO ROLE PMM_ROLE; GRANT USAGE ON SCHEMA "SNOWFLAKE_USAGE_TS"."ACCOUNT_USAGE" TO ROLE PMM_ROLE; GRANT SELECT ON QUERY_HISTORY IN SCHEMA "SNOWFLAKE_USAGE_TS"."ACCOUNT_USAGE" TO ROLE PMM_ROLE;

Connect Thoughtspot and Snowflake

Log into your ThoughtSpot instance and create an Embrace connection to each of the five following views:

  • DATABASESTORAGEUSAGE_HISTORY
  • QUERY_HISTORY
  • STAGES
  • STORAGE_USAGE
  • WAREHOUSEMETERINGHISTORY

Import TML Blocks

Import the TML for the worksheets(snowflaketmlblocksworksheets) and verify that it has all been imported without any errors. Import the TML for the liveboards(snowflaketmlblocksliveboards) and verify that it has all been imported without any errors.

Liveboards Included

Snowflake Query Volume

Snowflake Query Performance

Snowflake Query Credit Costs

Snowflake Stages

Snowflake Storage

Snowflake Warehouse Consumption

Get code