How it works
Each recording rule is scoped to a dataset and defined as a YAML document that follows the PrometheusRule specification.Inside the YAML you declare one or more rule groups, each with an evaluation interval and a list of rules entries that pair a record name with a PromQL expr. Dash0 evaluates these expressions on the configured cadence and writes the resulting series back into the dataset, ready for dashboards and alert conditions.
Dash0 CLI
cli-recording-rules.sh1234567891011121314# Create recording rules from a YAML filedash0 recording-rules create --dataset default -f recording-rules.yaml# List all recording rules in a datasetdash0 recording-rules list --dataset default# Get a single recording rule by IDdash0 recording-rules get --dataset default <id># Update an existing recording ruledash0 recording-rules update --dataset default <id> -f recording-rules.yaml# Delete a recording ruledash0 recording-rules delete --dataset default <id>
Dash0 Terraform Provider
recording-rule.tf1234resource "dash0_recording_rule" "http_metrics" {dataset = "default"recording_rule_yaml = file("${path.module}/rules/http-recording-rules.yaml")}
Dash0 Operator for Kubernetes
recording-rule.yaml12345678910111213141516171819apiVersion: operator.dash0.com/v1alpha1kind: Dash0RecordingRulemetadata:name: http-recording-rulesnamespace: monitoringspec:dataset: defaultcontent: |apiVersion: monitoring.coreos.com/v1kind: PrometheusRulemetadata:name: my-recording-rulesspec:groups:- name: http_metricsinterval: 1mrules:- record: http_requests:rate5mexpr: rate(http_requests_total[5m])
The operator syncs the recording rule to Dash0 and reports status back on the custom resource.