Example: Route alerts to Slack
This example shows how to route alert notifications to a Slack workspace using Notification Center.
The workflow uses a connector, a preset, and a router to send alerts to specific Slack channels based on alert priority.
Workflow overview
- Create a Slack connector: defines where notifications are sent
- Create a preset: defines how messages appear in Slack
- Create a router and routing rules: defines which alerts go to Slack
- Label alerts: ensures alerts match the correct router
Create a Slack connector
- Go to Integrations, then Notification Center, then Connectors.
- Select + New connector.
- Select Slack as the destination type.
- In Details, enter a connector name and optional description.
- In Configuration:
- Integration: Select the Slack integration. Create one if none exists.
- Channel: Enter a default Slack channel (for example,
#infra-alerts).
(Optional) Select Advanced, then Dynamic fields, define a dynamic channel.
Example:
Select Send test notification to confirm delivery.
- Select Create connector.
Create a preset (optional)
If you do not need message customization, use the system preset and skip this section.
To create a custom preset:
- Go to Integrations, then Notification Center, then Presets.
- Open the Alerts tab and select Slack.
- Select + New alert preset.
Customize message fields:
Field Example Title [{{ alertDef.priority }}] {{ alertDef.name }}Description {{ alertDef.description }}Footer Triggered at {{ alert.timestamp }}Use the Preview panel to review output.
- (Optional) Use Send test notification to validate with your Slack connector.
- Select Create preset.
Create a router and routing rule
- Go to Integrations, then Notification Center, then Routers.
- Select + New router.
- In Details, enter a name such as
Production Alerts. In Routing labels, add labels that this router matches:
Matching alerts appear in the Matching entities panel.
After creating the router, add a routing rule:
- Condition
- Destination
- Connector:
Slack – Prod - Preset:
Slack Critical Alerts
- Connector:
- (Optional) In Fallback, select a connector for unmatched alerts.
- Select Create router.
Add labels to alerts
- Go to Alerts, then Create alert.
In Labels, add routing labels that match your router:
In Notifications, select Notification Center.
- Save the alert.
Example result
A triggered alert produces a Slack message similar to:
Title:
[P1] CPU Usage High – Production
Body:
CPU usage for host server-1 exceeded 95%.
Footer:
Triggered at 2025-11-11 10:04 UTC
Next steps
- PagerDuty routing example: Route critical alerts to PagerDuty.
- Dynamic templating reference: Add dynamic channels and message logic.
- Routing rules: Add additional conditions and destinations to refine Slack delivery.