SnowPatrol: Snowflake Usage Anomaly Detection & Alerting System
SnowPatrol: Snowflake Usage Anomaly Detection & Alerting System
SnowPatrol: Snowflake Usage Anomaly Detection & Alerting System
This is a reference architecture meant to serve as inspiration for how to use Airflow. The SnowPatrol repository may not be actively maintained. If you’re looking for production-ready Snowflake cost management, consider Astro Observe.
SnowPatrol is an anomaly detection and alerting system for Snowflake built with Apache Airflow®. It uses an Isolation Forest model to detect anomalies in your Snowflake compute driving cost. Airflow Dags orchestrate feature engineering, model training, and prediction. Anomaly records are stored in a Snowflake table and alerts are sent to a Slack channel. The full source code is open-source and available on GitHub.

SnowPatrol serves a dual purpose:

SnowPatrol performs the following steps:
The Dags that power SnowPatrol highlight several key Airflow best practices and features:
@daily schedule, all other Dags are triggered based on updates to the datasets they depend upon.on_failure_callback in the default_args of the Dags.include folder and executed by SQLExecuteQueryOperator in the Dag. This makes the Dag code more readable and offers the ability to reuse SQL queries across multiple Dags.