Manage Synthetic Checks as Code
Synthetic checks 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 monitoring changes.
Agent0 can generate infrastructure-as-code configurations for synthetic checks and raise them as pull requests to your repository. After creating a synthetic check with Agent0, request the corresponding Terraform configuration or Kubernetes manifest to keep your observability in code. See Asset Creation for details.
Dash0 Operator for KubernetesRelease historyThis feature was introduced by Manage synthetic checks with the Dash0 Kubernetes Operator on September 8, 2025.
Define synthetic checks as Dash0SyntheticCheck custom resources that sync to Dash0, enabling workflows and native Kubernetes management.
Example
apiVersion: operator.dash0.com/v1alpha1
kind: Dash0SyntheticCheck
metadata:
name: frontend-health-check
namespace: production
spec:
enabled: true
display:
name: Frontend Health Check
plugin:
kind: http
spec:
request:
method: get
url: https://api.example.com/health
headers: []
queryParameters: []
redirects: follow
tls:
allowInsecure: false
assertions:
criticalAssertions:
- kind: status_code
spec:
value: "200"
operator: is
- kind: timing
spec:
type: response
operator: lte
value: 5000ms
degradedAssertions:
- kind: timing
spec:
type: response
operator: lte
value: 2000ms
schedule:
interval: 5m
locations:
- us-east
- eu-west
strategy: all_locations
retries:
kind: fixed
spec:
attempts: 3
delay: 1s
labels:
team: platform
service: frontendThe Dash0 Operator for Kubernetes watches for Dash0SyntheticCheck resources in namespaces with a Dash0 monitoring resource deployed. When it detects changes:
- New synthetic check resources are created as checks in Dash0.
- Modified resources update the corresponding checks.
- Deleted resources remove the corresponding checks.
Apply and Manage
# Apply the synthetic check
kubectl apply -f synthetic-check.yaml
# List all synthetic checks
kubectl get dash0syntheticchecks -n production
# View details
kubectl describe dash0syntheticcheck frontend-health-check -n production
# Update the synthetic check
kubectl edit dash0syntheticcheck frontend-health-check -n production
# Delete the synthetic check
kubectl delete dash0syntheticcheck frontend-health-check -n productionFor more information, refer to the Dash0 Operator for Kubernetes documentation.
Dash0 Terraform Provider
Manage synthetic checks in your Terraform infrastructure alongside other cloud resources for unified infrastructure management.
Example Usage
terraform {
required_providers {
dash0 = {
source = "dash0hq/dash0"
version = "~> 1.0"
}
}
}
provider "dash0" {
url = "https://api.dash0.com"
auth_token = "auth_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
resource "dash0_synthetic_check" "frontend_health" {
dataset = "production"
synthetic_check_yaml = <<-EOT
kind: Dash0SyntheticCheck
metadata:
name: api-health
spec:
enabled: true
display:
name: API Health Check
plugin:
kind: http
spec:
request:
method: get
url: https://api.example.com/health
assertions:
criticalAssertions:
- kind: status_code
spec:
value: "200"
operator: is
schedule:
interval: 5m
locations:
- us-east
strategy: all_locations
EOT
}For more information, see the dash0_synthetic_check resource documentation.
Dash0 CLI
Script synthetic check operations with the Dash0 CLI for automated deployments and batch operations.
Create from File
# Create a synthetic check from a YAML file
dash0 synthetic-checks create -f frontend-health.yamlList Synthetic Checks
# List all synthetic checks
dash0 synthetic-checks listGet Synthetic Check Details
# Get a single synthetic check as YAML
dash0 synthetic-checks get <id> -o yaml
# Get check details in JSON format
dash0 synthetic-checks get <id> -o jsonUpdate Synthetic Check
# Update an existing synthetic check
dash0 synthetic-checks update <id> -f frontend-health-updated.yamlDelete Synthetic Check
# Delete a synthetic check
dash0 synthetic-checks delete <id>Batch Operations
# Create multiple checks from a directory
for file in checks/*.yaml; do
dash0 synthetic-checks create -f "$file"
done
# Export all checks for backup
dash0 synthetic-checks list -o yaml > checks-backup.yamlFor more information, see the Dash0 CLI command reference.
Further Reading
- Manage Dashboards as CodeDefine and manage dashboards using infrastructure as code.
- Manage Views as CodeManage saved queries as infrastructure as code.
- Manage Check Rules as CodeDefine and manage check rules using infrastructure as code.
- Manage Notification Channels as CodeManage notification channels using infrastructure as code.
Last updated: