Slack
NotificationsScraper
Mission Control integrates with Slack to send notifications and scrape workspace data.
Notifications
Use cases:
- Send alerts to Slack channels when health checks fail or configs change
- Format notifications with Block Kit for rich, interactive messages
- Route notifications to different channels based on severity or team
- Track message delivery and notification history
Send notifications to Slack channels when events occur.
Basic Channel Notification
slack-notification.yamlapiVersion: mission-control.flanksource.com/v1
kind: Notification
metadata:
name: slack-alerts
spec:
events:
- check.failed
- check.passed
to:
slack:
channel: alerts
token:
valueFrom:
secretKeyRef:
name: slack-credentials
key: bot-token
Custom Message Template
slack-custom-notification.yamlapiVersion: mission-control.flanksource.com/v1
kind: Notification
metadata:
name: slack-incidents
spec:
events:
- incident.created
- incident.resolved
to:
slack:
channel: incidents
token:
valueFrom:
secretKeyRef:
name: slack-credentials
key: bot-token
title: "{{if eq .event \"incident.created\"}}:rotating_light:{{else}}:white_check_mark:{{end}} {{.incident.title}}"
body: |
*Severity:* {{.incident.severity}}
*Status:* {{.incident.status}}
{{if .incident.description}}*Description:* {{.incident.description}}{{end}}
Block Kit Formatting
slack-blocks-notification.yamlapiVersion: mission-control.flanksource.com/v1
kind: Notification
metadata:
name: slack-detailed
spec:
events:
- check.failed
to:
slack:
channel: engineering
token:
valueFrom:
secretKeyRef:
name: slack-credentials
key: bot-token
blocks: |
[
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":warning: Health Check Failed"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Check:*\n{{.check.name}}"
},
{
"type": "mrkdwn",
"text": "*Status:*\n{{.check.status}}"
}
]
}
]
Routing by Severity
slack-routing-notification.yamlapiVersion: mission-control.flanksource.com/v1
kind: Notification
metadata:
name: slack-routed
spec:
events:
- check.failed
filter: check.severity == "critical"
to:
slack:
channel: critical-alerts
token:
valueFrom:
secretKeyRef:
name: slack-credentials
key: bot-token
---
apiVersion: mission-control.flanksource.com/v1
kind: Notification
metadata:
name: slack-warnings
spec:
events:
- check.failed
filter: check.severity == "warning"
to:
slack:
channel: warnings
token:
valueFrom:
secretKeyRef:
name: slack-credentials
key: bot-token
Scraper
Use cases:
- Scrape Slack workspace data for compliance and audit purposes
- Track channel membership and user activity
- Monitor workspace configuration changes
slack-scraper.yamlapiVersion: configs.flanksource.com/v1
kind: ScrapeConfig
metadata:
name: slack-workspace
spec:
schedule: "@every 24h"
slack:
- token:
valueFrom:
secretKeyRef:
name: slack-credentials
key: bot-token
channels: true
users: true
Prerequisites
Create a Slack App with the following bot token scopes:
chat:write- Send messageschannels:read- List public channelsusers:read- List workspace members (for scraping)