Simple Example
More Robust Example
Production-ready with multiple tables and progressive alerting:2. Assess freshness
For each table result: Calculate status:- FRESH: hours_since_update < max_age_hours
- STALE: hours_since_update >= max_age_hours
- CRITICAL: hours_since_update > (max_age_hours * 2)
3. Alert based on severity
For CRITICAL issues (data > 2x SLA):-
Send Slack to #data-incidents:
βπ¨ CRITICAL: [table_name] data is [hours] hours old
Expected: < [max_age] hours
Last update: [last_update]
Possible causes:
- Pipeline failure
- Source API down
- Warehouse connection issue
- Create GitHub issue if doesnβt exist
- Page on-call if > 4 hours stale
- Send Slack to #data-pipeline: ββ οΈ WARNING: [table_name] is [hours] hours old Expected: < [max_age] hours Monitor closely.β
- No alert (all good)
- Log status for audit
4. Summary report
After checking all tables, send summary to #data-pipeline: βπ Hourly Freshness Check β Fresh: [fresh_count]/[total_count] β Stale: [warning_count] π¨ Critical: [critical_count] [if critical_count > 0] Immediate attention needed! Next check: [next_run_time]β5. Track trends
Log results to identify patterns:- Which tables fail most often?
- What time of day do failures occur?
- Are issues getting worse?
6. Include diagnostics
When data is stale, run diagnostics:- Check dbt Cloud job status (recent failures?)
- Check Fivetran connector (sync successful?)
- Check source count: SELECT COUNT(*) FROM raw.table
- Compare to warehouse: Is raw table updated?