Last updated:
Export Check Rules
Build check rules visually in Dash0, then export them as YAML for version control and deployment.
Once you have created check rules as defined in About Creating Check Rules, do the following:
-
Under Monitoring, open Alerting > Check Rules, or go directly to Check Rules.
-
Select a check rule and click YAML in the navigation bar at the top.
Export Format
The exported YAML follows the Prometheus PrometheusRule format, extended with Dash0-specific annotations (dash0-threshold-critical, dash0-threshold-degraded, and dash0-enabled). A check rule that sets When no data also carries the dash0.com/on-no-data annotation, see No Data:
yaml
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: adservice
spec:
groups:
- name: Alerting
interval: 1m0s
rules:
- alert: adservice
expr: (sum by (service_namespace, service_name) (increase({otel_metric_name = "dash0.spans", service_name = "adservice", service_namespace = "opentelemetry-demo", dash0_operation_name != "", otel_span_status_code = "ERROR"}[5m]))) / (sum by (service_namespace, service_name) (increase({otel_metric_name = "dash0.spans", service_name = "adservice", service_namespace = "opentelemetry-demo", dash0_operation_name != ""}[5m])) > 0)*100 > $__threshold
for: 0s
keep_firing_for: 0s
annotations:
summary: 'High error percentage for adservice: {{$value|printf "%.2f"}}%'
description: 'High error percentage for adservice: {{$value|printf "%.2f"}}%'
dash0-threshold-critical: "40"
dash0-threshold-degraded: "35"
dash0-enabled: "true"
labels: {}Further Reading
- About Check Rules — Create and configure check rules in Dash0.
- Manage Check Rules as Code — Deploy check rules using the Dash0 Operator for Kubernetes, the Dash0 Terraform Provider, or the Dash0 CLI.