Last updated: May 29, 2026
Manage Notification Channels as Code
Notification channels are Dash0 assets that can be versioned and managed as infrastructure as code. This approach enables version control, automated deployment pipelines, consistent configuration across environments, and code review for notification routing changes.
Dash0 Operator for Kubernetes
Define notification channels as Dash0NotificationChannel custom resources that sync to Dash0, enabling workflows and native Kubernetes management.
Example
1234567891011121314kind: Dash0NotificationChannelmetadata:name: platform-team-slackspec:type: slack_botconfig:channel: "#platform-team"teamId: T04QG2LAK7Xfrequency: 6h0m0srouting:filters:- - key: teamoperator: isvalue: platform
For more examples, including routing rules, see Configuration Options and Routing Rules.
The Dash0 Operator for Kubernetes watches for Dash0NotificationChannel resources and syncs them to your Dash0 organization. The operator reports status back on the custom resource.
Apply and Manage
1234567891011121314# Apply the notification channelkubectl apply -f notification-channel.yaml# List all notification channelskubectl get dash0notificationchannels -n monitoring# View detailskubectl describe dash0notificationchannel slack-platform-alerts -n monitoring# Update the notification channelkubectl edit dash0notificationchannel slack-platform-alerts -n monitoring# Delete the notification channelkubectl delete dash0notificationchannel slack-platform-alerts -n monitoring
Dash0 Terraform Provider
Manage notification channels in your Terraform infrastructure alongside other cloud resources for unified infrastructure management.
Example Usage
Slack Webhook:
123456789101112131415161718192021222324252627terraform {required_providers {dash0 = {source = "dash0hq/dash0"version = "~> 1.0"}}}provider "dash0" {url = "https://api.dash0.com"auth_token = "auth_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}resource "dash0_notification_channel" "slack_webhook" {notification_channel_yaml = <<-EOFkind: Dash0NotificationChannelmetadata:name: Slack Alertsspec:type: slackconfig:webhookURL: "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"channel: "#alerts"frequency: 10mEOF}
Webhook with Routing Rules:
Routing rules control which alerts are delivered to this channel. Each top-level list item is an OR group; conditions within a group are ANDed. In this example, notifications are sent when: (team.name = "sre" AND deployment.environment.name = "production") OR (service.severity = "critical")
12345678910111213141516171819202122232425262728293031323334353637terraform {required_providers {dash0 = {source = "dash0hq/dash0"version = "~> 1.0"}}}provider "dash0" {url = "https://api.dash0.com"auth_token = "auth_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}resource "dash0_notification_channel" "webhook_with_routing" {notification_channel_yaml = <<-EOFkind: Dash0NotificationChannelmetadata:name: Production Alerts (Webhook with Routing)spec:type: webhookconfig:url: "https://example.com/webhook/production-alerts"frequency: 5mrouting:filters:- - key: team.nameoperator: isvalue: sre- key: deployment.environment.nameoperator: isvalue: production- - key: service.severityoperator: isvalue: criticalEOF}
For more examples and related information, see the Dash0 Terraform provider documentation.
Dash0 CLI
Script notification channel operations with the Dash0 CLI for automated deployments and batch operations.
Create from File
12# Create a notification channel from a YAML filedash0 -X notification-channels create -f slack-alerts.yaml
List Channels
1234567891011# List all notification channelsdash0 -X notification-channels list# List all notification channels as YAMLdash0 -X notification-channels list -o yaml# List all notification channels in JSON formatdash0 -X notification-channels list -o json# List all notification channels as CSVdash0 -X notification-channels list -o csv
Get Channel Details
12345678# Get a single notification channel as YAMLdash0 -X notification-channels get <id> -o yaml# Get channel details in JSON formatdash0 -X notification-channels get <id> -o json# Get channel details in table formatdash0 -X notification-channels get <id> -o table
Update Channel
12# Update an existing notification channeldash0 -X notification-channels update <id> -f slack-alerts-updated.yaml
Delete Channel
12# Delete a notification channeldash0 -X notification-channels delete <id>
For more information, see the Dash0 CLI documentation.
Configuration Options
Channel Definition Format
Each notification channel is defined as a YAML document with kind: Dash0NotificationChannel.
The spec.type field selects the channel type and spec.config holds the type-specific settings.
Example: PagerDuty notification channel
1234567891011121314151617181920kind: Dash0NotificationChannelmetadata:name: pagerduty-oncallspec:type: pagerdutyconfig:key: your-integration-key-hereurl: ""frequency: 6h0m0srouting:filters:- - key: service.nameoperator: isvalue: productcatalogservice- - key: service.nameoperator: isvalue: frontend- key: dash0.resource.typeoperator: isvalue: synthetic
For information on frequency, see Frequency and for information on routing.filters, see Routing Rules.
Frequency
The frequency field controls rate limiting to prevent notification storms. Dash0 will not send more than one notification per channel within the specified time window.
123spec:type: slackfrequency: 10m # Maximum one notification per 10 minutes
Common values:
5m- High-priority channels (PagerDuty, oncall)10m- Standard channels (team Slack channels)30m- Low-priority channels (email summaries)
Routing Rules
Routing rules determine which failed checks trigger notifications on a channel.
Dash0 provides two ways to associate check rules with notification channels via infrastructure as code:
- Direct assignment — Notification channels can be referenced by ID from individual check rules, as described in Manage Check Rules as Code:
dash0.com/notification-channel-ids: ded5721c-2bf0-4a10-ab33-511fef734b0f,56aaacb2-10c6-4cef-8aeb-d7c862ad863e
-
Label-based routing — Each channel can decide which failed checks it notifies on through its own routing rules: when a check fires, Dash0 evaluates every channel's
routing.filters, as explained below, against the labels and attributes of the failed check and delivers the notification on each channel whose filters match.To send a check rule's alerts to a specific channel:
- Make sure the check emits labels or attributes — such as
team,service.name, ordash0.resource.type— that match the channel's routing filters. - To route by severity, filter the channel on
dash0.failed_check.max_status(degradedorcritical), as shown in the examples below.
- Make sure the check emits labels or attributes — such as
Basic Routing by Label
Route alerts based on a single label match:
1234567891011121314kind: Dash0NotificationChannelmetadata:name: platform-team-slackspec:type: slack_botconfig:channel: "#platform-team"teamId: T04QG2LAK7Xfrequency: 6h0m0srouting:filters:- - key: teamoperator: isvalue: platform
This channel receives alerts from any check rule that has the label team=platform. The filters array contains one condition (the outer array), which itself contains one matcher (the inner array). Since there's only one condition with one matcher, this is a simple equality check.
Multiple Conditions (OR Logic)
Route alerts that match ANY of the specified conditions (disjunction):
1234567891011121314151617kind: Dash0NotificationChannelmetadata:name: platform-team-slackspec:type: slack_botconfig:channel: "#platform-team"teamId: T04QG2LAK7Xfrequency: 6h0m0srouting:filters:- - key: teamoperator: isvalue: platform- - key: teamoperator: isvalue: sre
This channel receives alerts labeled team=platform OR team=sre. The filters array contains two conditions (two items in the outer array), and conditions are combined with OR logic. Each condition contains a single matcher, so an alert matches if it has either label value.
Multiple Matchers per Condition (AND Logic)
Require ALL matchers within a condition to match (conjunction):
1234567891011121314151617kind: Dash0NotificationChannelmetadata:name: platform-team-slackspec:type: slack_botconfig:channel: "#platform-team"teamId: T04QG2LAK7Xfrequency: 6h0m0srouting:filters:- - key: service.nameoperator: isvalue: frontend- key: dash0.failed_check.max_statusoperator: isvalue: critical
This channel only receives alerts where service_name=frontend AND dash0.failed_check.max_status=critical. The filters array contains one condition (one item in the outer array), but that condition contains two matchers (two items in the inner array). Matchers within the same condition are combined with AND logic, so both must be true for the alert to be routed to this channel.
Complex Routing (AND + OR)
Combine multiple conditions with multiple matchers:
123456789101112131415161718192021222324252627kind: Dash0NotificationChannelmetadata:name: critical-backend-servicesspec:type: pagerdutyconfig:key: your-integration-keyurl: ""frequency: 6h0m0srouting:filters:# Condition 1: Critical alerts for checkout service- - key: service.nameoperator: isvalue: checkout- key: dash0.failed_check.max_statusoperator: is_one_ofvalues:- CRITICAL# Condition 2: Critical alerts for payment service- - key: service.nameoperator: isvalue: payment- key: dash0.failed_check.max_statusoperator: is_one_ofvalues:- CRITICAL
This routes alerts where:
- (
service_name=checkoutANDdash0.failed_check.max_status=critical) OR - (
service_name=paymentANDdash0.failed_check.max_status=critical)
The filters array contains two conditions (two items in the outer array), and each condition contains two matchers (two items in each inner array). Within each condition, both matchers must match (AND logic). Across conditions, only one condition needs to match (OR logic). This pattern lets you route alerts from multiple services but only when they reach critical severity.
Further Reading
- Manage Dashboards as Code — Define and manage dashboards using infrastructure as code.
- Manage Views as Code — Manage saved queries as infrastructure as code.
- Manage Check Rules as Code — Define and manage check rules using infrastructure as code.
- Manage Synthetic Checks as Code — PrometheusRule CRDs with the Dash0 Operator for Kubernetes, Dash0 Terraform provider resources, and Dash0 CLI commands