RepoSnowflake (Arctic)Snowflake (Arctic)published Apr 29, 2026seen 5d

Snowflake-Labs/snowflake360-self-assessment

Python

Open original ↗

Captured source

source ↗

Snowflake-Labs/snowflake360-self-assessment

Language: Python

License: Apache-2.0

Stars: 1

Forks: 1

Open issues: 0

Created: 2026-04-29T22:08:55Z

Pushed: 2026-05-15T08:29:55Z

Default branch: main

Fork: no

Archived: no

README:

Snowflake 360 Self-Assessment

A Streamlit-in-Snowflake (SiS) application that provides a guided health-check of a Snowflake account across 8 operational topic areas. All analysis is performed using SNOWFLAKE.ACCOUNT_USAGE views and Snowflake Cortex AI — no external dependencies or data egress.

---

Architecture

┌─────────────────────────────────────────────────────────────────┐
│ Streamlit in Snowflake │
│ │
│ app.py ─── navigation, Home page (LLM selector + batch run) │
│ │ │
│ ├── components// │
│ │ ├── *_overview.py ← SQL queries → session_state │
│ │ └── *_analysis.py ← Cortex AI prompts + render │
│ │ │
│ ├── core/ │
│ │ ├── data/catalog.json ← tab/component registry │
│ │ ├── config/ ← design tokens, app settings │
│ │ ├── export_collectors.py ← per-topic HTML export │
│ │ └── export_telemetry.py ← Chart.js HTML renderer │
│ │ │
│ └── metrics/ ← metric base classes │
│ │
│ Data source: SNOWFLAKE.ACCOUNT_USAGE (read-only) │
│ AI service: SNOWFLAKE.CORTEX.AI_COMPLETE() │
└─────────────────────────────────────────────────────────────────┘

Topics

| Topic | Component Folder | |---|---| | Database Management | components/Database_Management/ | | Data Governance | components/Data_Governance_New/ | | Virtual Warehouses | components/Virtual_Warehouses/ | | Access Control | components/Access_Control/ | | Data Ingestion | components/Data_Ingestion/ | | Data Transformation | components/Data_Transformation/ | | FinOps (lite) | components/FinOps_Lite/ | | Data Recovery & DevOps | components/Data_Recovery_DevOps/ |

Where Analyzer Prompts Are Stored

Prompts are inline Python inside each topic's *_analysis.py (or *_analyzer.py) file — there are no external prompt tables or stored procedures.

| Topic | Prompt file | |---|---| | Virtual Warehouses | components/Virtual_Warehouses/warehouse_prompt.py + warehouse_analysis.py | | Database Management | components/Database_Management/db_management_analysis.py | | Data Governance | components/Data_Governance_New/governance_analyzer.py | | Access Control | components/Access_Control/access_control_analysis.py | | Data Ingestion | components/Data_Ingestion/ingestion_analysis.py | | Data Transformation | components/Data_Transformation/transformation_analysis.py | | FinOps (lite) | components/FinOps_Lite/finops_analysis.py | | Data Recovery & DevOps | components/Data_Recovery_DevOps/recovery_devops_analyzer.py |

Each _analysis.py follows the same pattern: 1. _gather_data() — queries SNOWFLAKE.ACCOUNT_USAGE and builds a text summary 2. _call_cortex() — calls SNOWFLAKE.CORTEX.AI_COMPLETE(model, prompt) with the gathered data injected into the prompt 3. comp_*_analysis() — Streamlit render function (tabs, markdown, expanders)

---

Snowflake Objects

Defaults

| Object | Default name | Configurable | |---|---|---| | Database | DEMOS | Yes (--database) | | Schema | S360_SELF_ASSESS | Yes (--schema) | | Warehouse | S360_WH | Yes (--warehouse) | | Streamlit app | S360_SELF_ASSESSMENT | No | | Stage | ..S360_SELF_ASSESSMENT | No | | Role | ACCOUNTADMIN | Yes (--role) |

ACCOUNT_USAGE Views Used

The app reads the following SNOWFLAKE.ACCOUNT_USAGE views:

| Category | Views | |---|---| | Compute | WAREHOUSE_METERING_HISTORY, WAREHOUSE_LOAD_HISTORY, WAREHOUSE_EVENTS_HISTORY, WAREHOUSE_PRISM | | Queries | QUERY_HISTORY, QUERY_ACCELERATION_ELIGIBLE, QUERY_ACCELERATION_HISTORY, QUERY_ATTRIBUTION_HISTORY | | Storage | DATABASE_STORAGE_USAGE_HISTORY, TABLE_STORAGE_METRICS, STORAGE_USAGE | | Objects | DATABASES, SCHEMATA, TABLES, VIEWS, COLUMNS, FUNCTIONS, PROCEDURES, FILE_FORMATS | | Governance | TAGS, TAG_REFERENCES, MASKING_POLICIES, ROW_ACCESS_POLICIES, POLICY_REFERENCES | | Access | USERS, ROLES, GRANTS_TO_ROLES, GRANTS_TO_USERS, LOGIN_HISTORY, SESSIONS | | Security | PASSWORD_POLICIES, SESSION_POLICIES, NETWORK_POLICIES, NETWORK_RULES, NETWORK_RULE_REFERENCES, TRUST_CENTER_FINDINGS | | Ingestion | PIPES, PIPE_USAGE_HISTORY, COPY_HISTORY | | Transformation | AUTOMATIC_CLUSTERING_HISTORY, MATERIALIZED_VIEW_REFRESH_HISTORY, DYNAMIC_TABLE_REFRESH_HISTORY, SEARCH_OPTIMIZATION_HISTORY, OBJECT_DEPENDENCIES, CLASS_INSTANCES, SEMANTIC_VIEWS | | Cost | METERING_DAILY_HISTORY, DATA_TRANSFER_HISTORY, SERVERLESS_TASK_HISTORY, SNOWPARK_CONTAINER_SERVICES_HISTORY, RESOURCE_MONITORS, ANOMALIES_DAILY | | Tasks | TASK_HISTORY, ACCESS_HISTORY |

---

Required Privileges

The role used to run the app needs:

-- 1. Read ACCOUNT_USAGE views
GRANT IMPORTED PRIVILEGES ON DATABASE SNOWFLAKE TO ROLE ;

-- 2. Use Cortex AI (all analyzer tabs)
GRANT DATABASE ROLE SNOWFLAKE.CORTEX_USER TO ROLE ;

-- 3. Warehouse access
GRANT USAGE ON WAREHOUSE TO ROLE ;

-- 4. Database and schema access
GRANT USAGE ON DATABASE TO ROLE ;
GRANT USAGE ON SCHEMA . TO ROLE ;

-- 5. Create and run the Streamlit app + stage
GRANT CREATE STREAMLIT ON SCHEMA . TO ROLE ;
GRANT CREATE STAGE ON SCHEMA . TO ROLE ;

> Simplest approach: use ACCOUNTADMIN — it has all of the above by default.

---

Prerequisites

Snowflake CLI (Option A only)

The scripted install requires the Snowflake CLI (`snow`) version 2.x or later.

Install it:

# macOS
brew install snowflake-cli

# pip (any OS)
pip install snowflake-cli

# Verify
snow --version

Then configure a connection:

snow connection add
# Follow the prompts — account, user, role, warehouse

snow connection test --connection
# Should print: ✓ Connection successful

Full docs: https://docs.snowflake.com/en/developer-guide/snowflake-cli/installation/installation

Role

The role you specify must already exist in Snowflake. The install scripts do not create roles.

  • Default is ACCOUNTADMIN — it always exists and has all required privileges
  • If using a custom role, create it first and ensure it has CREATE WAREHOUSE, CREATE DATABASE privileges (or pre-create the warehouse/database yourself)

---

What the Install Scripts Create

| Object | Created by script? | Notes | |---|---|---| | Warehouse | ✅ Yes (CREATE WAREHOUSE IF NOT EXISTS) | XSMALL,…

Excerpt shown — open the source for the full document.

Notability

notability 1.0/10

Very low traction, routine repo