Slack Integration¶
Get notified in Slack when drift is detected.
Installation¶
Setup¶
1. Create Slack Webhook¶
- Go to Slack API
- Create new app
- Enable "Incoming Webhooks"
- Add webhook to workspace
- Copy webhook URL
2. Configure Alerter¶
from driftwatch.integrations.alerting import SlackAlerter
alerter = SlackAlerter(
webhook_url="https://hooks.slack.com/services/YOUR/WEBHOOK/URL",
throttle_minutes=60 # Max 1 alert per hour
)
Usage¶
from driftwatch import Monitor
monitor = Monitor(reference_data=train_df)
report = monitor.check(prod_df)
if report.has_drift():
alerter.send(report)