| name | snowflake-observability |
| description | Set up Snowflake observability using ACCOUNT_USAGE views, alerts, and external monitoring.
Use when implementing Snowflake monitoring dashboards, setting up query performance tracking,
or configuring alerting for warehouse and pipeline health.
Trigger with phrases like "snowflake monitoring", "snowflake metrics",
"snowflake observability", "snowflake dashboard", "snowflake alerts".
|
| allowed-tools | Read, Write, Edit |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","data-warehouse","analytics","snowflake"] |
| compatibility | Designed for Claude Code |
Snowflake Observability
Overview
Set up comprehensive observability for Snowflake using built-in ACCOUNT_USAGE views, Snowflake Alerts, and integration with external monitoring systems.
Prerequisites
- Role with access to
SNOWFLAKE.ACCOUNT_USAGE (ACCOUNTADMIN or granted)
- Notification integration configured for alerts
- Optional: Prometheus/Grafana or Datadog for external dashboards
Instructions
Step 1: Key Monitoring Queries
SELECT warehouse_name,
COUNT(*) AS query_count,
ROUND(AVG(total_elapsed_time) / 1000, 1) AS avg_seconds,
ROUND(PERCENTILE_CONT(0.95) WITHIN GROUP (ORDER BY total_elapsed_time) / 1000, 1) AS p95_seconds,
ROUND(PERCENTILE_CONT(0.99) WITHIN GROUP (ORDER BY total_elapsed_time) / 1000, 1) AS p99_seconds
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
WHERE start_time >= DATEADD(days, -7, CURRENT_TIMESTAMP())
AND execution_status = 'SUCCESS'
AND query_type =
warehouse_name
avg_seconds ;
DATE_TRUNC(, start_time) ,
COUNT_IF(execution_status ) success,
COUNT_IF(execution_status ) failures,
ROUND(COUNT_IF(execution_status )
((), ), ) error_rate_pct
SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
start_time DATEADD(hours, , ())
;
DATE_TRUNC(, start_time) ,
warehouse_name,
(credits_used) credits
SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY
start_time DATEADD(hours, , ())
, warehouse_name
, credits ;
usage_date,
ROUND(storage_bytes , ) storage_tb,
ROUND(stage_bytes , ) stage_tb,
ROUND(failsafe_bytes , ) failsafe_tb
SNOWFLAKE.ACCOUNT_USAGE.STORAGE_USAGE
usage_date DATEADD(days, , ())
usage_date;