Pipeline failures happen. The difference between a minor hiccup and a major incident is Time To Detection (TTD).
Snowflake now provides a robust, native framework for Alerts and Notifications. You don’t need Airflow or external monitoring tools for basic health checks. You can do it all in the database.
The Components
- Notification Integration: The bridge to the outside world (Email, Slack, MS Teams, PagerDuty).
- Alert Object: A scheduled check that evaluates a condition.
- System stored procedures:
SYSTEM$SEND_EMAILorSYSTEM$SEND_SNOWFLAKE_NOTIFICATION.
Step 1: Create Email Integration
CREATE OR REPLACE NOTIFICATION INTETRATION email_int
TYPE = EMAIL
ENABLED = TRUE
ALLOWED_RECIPIENTS = ('[email protected]');sqlStep 2: Define the Alert Logic
Let’s alert if our critical table FACT_SALES hasn’t received data in the last hour.
CREATE OR REPLACE ALERT stale_data_alert
WAREHOUSE = MONITORING_WH
SCHEDULE = '15 MINUTE'
IF(EXISTS(
SELECT 1
FROM monitoring_db.pipeline_logs
WHERE table_name = 'FACT_SALES'
AND last_load_ts < DATEADD(hour, -1, CURRENT_TIMESTAMP())
))
THEN
CALL SYSTEM$SEND_EMAIL(
'email_int',
'[email protected]',
'CRITICAL: Stale Sales Data',
'FACT_SALES has not updated in 1 hour. Check the Fivetran connector.'
);sqlStep 3: Managing Alerts
Alerts are objects. You can ALTER ALERT ... RESUME and SUSPEND.
Pro-tip: Create a dashboard in Snowsight that queries INFORMATION_SCHEMA.ALERT_HISTORY to show a log of all
triggered alerts.
Advanced: Webhooks to Slack
For Slack messages, you can use the WEBHOOK integration type (if enabled/available in your region) or use an External
Function to call the Slack API. This allows for richer formatting (blocks, buttons) than standard email.
Conclusion
Observability is key to trust. By baking alerts directly into the Data Cloud, we ensure that the data team detects issues before the business users do.