Slack Alerts
Saturn integrates with Slack using OAuth for rich, interactive notifications with Block Kit formatting and slash commands.
Setup
1. Install Slack App
- Go to Settings → Integrations → Slack
- Click Add to Slack
- Choose workspace and channel
- Authorize permissions
- Test connection
2. Required Scopes
Saturn requests these OAuth scopes:
chat:write- Send messageschat:write.public- Post to any channelchannels:read- List channelsusers:read- Display user namescommands- Slash commands (optional)
Message Format
Saturn uses Block Kit for rich formatting:
🔴 FAIL: Database Backup
Monitor: Database Backup
Status: OPEN • Severity: HIGH
Time: 2025-10-14 03:15:23 UTC
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💥 Exit Code: 1
⏱ Duration: 3.2s (expected: ~12m)
Error Output:
ERROR: Connection to database failed Host: db.prod.example.com:5432 Reason: Connection timeout
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[View Incident] [Acknowledge] [View Monitor]
Threaded Updates
Incident updates are posted as thread replies:
Initial Message:
┌───────────── ────────────────────────┐
│ 🔴 FAIL: Database Backup │
│ Time: 03:15 UTC │
│ [View] [Acknowledge] │
└─────────────────────────────────────┘
└─ 💬 3 replies
Thread Replies:
┌─────────────────────────────────────┐
│ 👤 Alice acknowledged at 03:17 │
└─────────────────────────────────────┘
┌─────────────────────────────────────┐
│ 📝 Note added: Checking DB logs │
└─────────────────────────────────────┘
┌─────────────────────────────────────┐
│ ✅ Incident resolved at 03:28 │
│ MTTR: 13 minutes │
└─────────────────────────────────────┘
Slash Commands
Use Saturn commands in Slack:
/saturn status
/saturn status
Response:
═══════════════════════════════════════
Saturn Status
═══════════════════════════════════════
📊 Overall Health: 87 (B+)
✓ Healthy: 42 monitors
⚠ Warning: 3 monitors
✗ Critical: 0 monitors
🚨 Open Incidents: 2
- LATE: API Sync (5 min ago)
- ANOMALY: ETL Pipeline (12 min ago)
[View Dashboard]
/saturn ack <incident_id>
/saturn ack inc_abc123
Response: ✓ Acknowledged incident inc_abc123
/saturn monitors
/saturn monitors
Response:
Recent Monitors:
1. Database Backup - ✓ OK (A, 95)
2. API Health Check - ✓ OK (A+, 98)
3. ETL Pipeline - ⚠ ANOMALY (B, 84)
[View All Monitors]
Interactive Buttons
Click buttons directly in Slack:
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {"type": "plain_text", "text": "Acknowledge"},
"action_id": "ack_incident",
"value": "inc_abc123",
"style": "primary"
},
{
"type": "button",
"text": {"type": "plain_text", "text": "View Incident"},
"url": "https://saturn.example.com/incidents/inc_abc123"
},
{
"type": "button",
"text": {"type": "plain_text", "text": "Suppress 1h"},
"action_id": "suppress_incident",
"value": "inc_abc123:3600"
}
]
}
Multiple Channels
Route different incidents to different channels:
{
"slack": {
"channels": [
{
"name": "#alerts-critical",
"channelId": "C01ABC123",
"rules": {
"severity": ["HIGH"],
"types": ["MISSED", "FAIL"]
}
},
{
"name": "#alerts-warnings",
"channelId": "C02DEF456",
"rules": {
"severity": ["MEDIUM", "LOW"],
"types": ["LATE", "ANOMALY"]
}
}
]
}
}
Mentions and Notifications
@mentions
{
"slack": {
"mentions": {
"FAIL": ["@oncall"],
"MISSED": ["@oncall"],
"LATE": [],
"ANOMALY": []
}
}
}
User Group Mentions
🔴 FAIL: Production API
<!subteam^S01ABC123|@oncall> Database backup failed
@channel / @here
{
"slack": {
"channelMentions": {
"enabled": true,
"severity": ["HIGH"] // Only for critical
}
}
}
Rate Limiting
Slack enforces rate limits:
- 1 message/second per channel
- Tier 2 methods: 20 req/min
- Tier 3 methods: 50 req/min
Saturn automatically:
- Queues messages if rate limited
- Retries with exponential backoff
- Batches updates when possible
Testing
Send test message:
curl -X POST https://api.saturn.example.com/api/alerts/slack/test \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"channelId": "C01ABC123"}'
Troubleshooting
Not Receiving Messages
Check:
- Slack app installed?
- Bot invited to channel? (
/invite @Saturn) - Routing rules match?
- Channel ID correct?
Permission Errors
Error: not_in_channel
Fix: Invite bot to channel:
/invite @Saturn
Messages Not Threaded
Cause: Original message deleted or thread limit reached
Solution: Messages fall back to new top-level messages
Best Practices
✅ Do
- Separate channels by severity
- Use threads to reduce noise
- Invite bot to all alert channels
- Test routing before going live
- Document escalation in channel topic
❌ Don't
- @channel everything - alert fatigue
- Mix priorities in one channel
- Delete bot messages - breaks threading
- Ignore rate limits - messages will queue
API Reference
# Add Slack channel
POST /api/alerts/slack/channels
Body: {
"channelId": "C01ABC123",
"rules": {...}
}
# Update routing
PATCH /api/alerts/slack/channels/<CHANNEL_ID>
# Remove channel
DELETE /api/alerts/slack/channels/<CHANNEL_ID>
# Send test
POST /api/alerts/slack/test
Body: {"channelId": "C01ABC123"}
Next Steps
- Discord Alerts — Discord webhook integration
- Email Alerts — Email notifications
- Webhooks — Custom integrations