Planekeeper is currently in alpha development. Features and APIs may change. Feedback is welcome! Request early access to get started.

Send notifications to Slack

Set up Slack webhook notifications with simple text templates and Block Kit JSON templates for rich formatting.

This recipe configures Planekeeper to send alert notifications to a Slack channel. Slack supports both simple text messages and rich Block Kit formatting through incoming webhooks.


Prerequisites

  • A running Planekeeper instance with at least one alert config
  • A Slack workspace where you can create apps

Step 1: Create a Slack incoming webhook

  1. Go to api.slack.com/apps and click Create New App
  2. Choose From scratch, name it Planekeeper, and select your workspace
  3. Go to Incoming Webhooks and toggle it On
  4. Click Add New Webhook to Workspace
  5. Select the channel where you want notifications
  6. Copy the webhook URL

The URL looks like: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX


Step 2: Create a notification channel in Planekeeper

  1. Navigate to Notification Channels in the sidebar
  2. Click Create Channel
  3. Fill in the fields:
FieldValue
NameSlack Alerts
Channel Typewebhook
URLPaste your Slack webhook URL
  1. Check Use Event-Specific Templates
  2. Add the templates from step 3 below
  3. Click Create

Step 3: Add Slack templates

Choose either simple text templates or Block Kit templates depending on how much formatting you want.

Simple text

### New alert template

```json title="New Alert / Escalated"
{"text": ":rotating_light: *{{.Alert.Severity | upper}}*: {{.Alert.ConfigName}}\nArtifact: {{.Alert.ArtifactName}}\nVersion {{.Alert.DiscoveredVersion}} is {{.Alert.BehindBy}} behind latest ({{.Alert.LatestVersion}})\n<{{.AcknowledgeURL}}|Click to Acknowledge>"}
```

### Acknowledged template

```json title="Acknowledged / Unacknowledged"
{"text": "{{if .IsAcknowledged}}:white_check_mark: *Acknowledged*{{else}}:arrows_counterclockwise: *Unacknowledged*{{end}}: {{.Alert.ConfigName}} - {{.Alert.ArtifactName}}{{if .IsAcknowledged}}\nAcknowledged by {{.AcknowledgedBy}}{{end}}"}
```

### Resolved template

```json title="Resolved"
{"text": ":tada: *Resolved*: {{.Alert.ConfigName}} - {{.Alert.ArtifactName}}\nThe alert has been automatically resolved."}
```

Block Kit (rich format)

### New alert template

```json title="New Alert / Escalated (Block Kit)"
{"blocks": [{"type": "header", "text": {"type": "plain_text", "text": "{{.Alert.Severity | upper}} Alert"}}, {"type": "section", "fields": [{"type": "mrkdwn", "text": "*Config:*\n{{.Alert.ConfigName}}"}, {"type": "mrkdwn", "text": "*Artifact:*\n{{.Alert.ArtifactName}}"}, {"type": "mrkdwn", "text": "*Current:*\n{{.Alert.DiscoveredVersion}}"}, {"type": "mrkdwn", "text": "*Latest:*\n{{.Alert.LatestVersion}}"}]}, {"type": "actions", "elements": [{"type": "button", "text": {"type": "plain_text", "text": "Acknowledge"}, "url": "{{.AcknowledgeURL}}", "style": "primary"}]}]}
```

### Acknowledged template

```json title="Acknowledged / Unacknowledged (Block Kit)"
{"blocks": [{"type": "section", "text": {"type": "mrkdwn", "text": "{{if .IsAcknowledged}}:white_check_mark: *Acknowledged*: {{.Alert.ConfigName}}\nBy {{.AcknowledgedBy}}{{else}}:arrows_counterclockwise: *Unacknowledged*: {{.Alert.ConfigName}}{{end}}"}}]}
```

### Resolved template

```json title="Resolved (Block Kit)"
{"blocks": [{"type": "section", "text": {"type": "mrkdwn", "text": ":tada: *Resolved*: {{.Alert.ConfigName}} - {{.Alert.ArtifactName}}\nThe alert has been automatically resolved."}}]}
```

Step 4: Test the channel

  1. Go to Notification Channels and find Slack Alerts
  2. Click Test
  3. Check your Slack channel for the test message
  4. If the test fails, verify:
    • The webhook URL is correct
    • The Slack app is still installed in your workspace
    • The target channel still exists

Step 5: Create a notification rule

  1. Navigate to Notification Rules in the sidebar
  2. Click Create Rule
  3. Fill in the fields:
FieldValue
NameAll Alerts to Slack
ChannelSelect Slack Alerts
Severity FilterLeave empty (matches all severities)
Event FilterLeave empty (matches all events)
  1. Click Create

Routing different severities to different channels

Create separate Slack channels and notification rules for different severity levels:

Notification ruleSeverity filterSlack channel
Critical to Pager Channelcritical#ops-critical
High to Alerts Channelhigh#ops-alerts
Moderate to Info Channelmoderate#ops-info

This requires creating three notification channels in Planekeeper (one per Slack channel) and three notification rules with different severity filters.

success

Use Block Kit for critical alerts

Block Kit formatting with the acknowledge button is especially useful for critical alerts where you want one-click acknowledgment directly from Slack.