SnowKill is a near real-time query monitoring tool for Snowflake Data Cloud.
SnowKill helps to detect potential problems with queries which are currently running. It analyzes query stats and plans, detects bad patterns, generates notifications and optionally "kills" some queries automatically.
The core logic of SnowKill relies on internal REST API calls instead of SQL queries. It does not require an active warehouse to run, which makes it possible to maintain the constant monitoring almost free of charge.
SnowKill has programmatic access to query plan from "Query Profile" page in SnowSight. SnowKill also has access to information about locks and tries to report the exact reason for transaction collisions.
SnowKill operates on present data, which normally allows it to react much faster relative to conventional monitoring tools operating on past data from QUERY_HISTORY
and GET_QUERY_OPERATOR_STATS
.
- Load list of queries which are currently
RUNNING
,QUEUED
orBLOCKED
. - Load additional information about query plans and active locks, if necessary.
- Check queries against list of fully customizable conditions.
- Optionally terminate matched queries exceeding specific thresholds.
- Detect and skip previously reported queries, avoid duplicates.
- Send notifications about newly matched queries (via Slack, Email, etc.).
Built-in conditions:
- Blocked Duration
- Cartesian Join Explosion
- Estimated Scan Duration
- Execute Duration
- Join Explosion
- Storage Spilling
- Queued Duration
- Union without ALL
Built-in formatters:
Built-in storages:
- More conditions, formatters, storages.
- Automated testing on push.
- Maybe some conditions for groups of queries, e.g. "more than 4 queries are queued on warehouse".
Please use GitHub "Issues" to report bugs and technical problems.
Please use GitHub "Discussions" to ask questions and provide feedback.
Vitaly Markov, 2023
Enjoy!