Last updated:
dash0_synthetic_check
Terraform resource for Dash0 synthetic checks — HTTP-based availability and correctness probes with configurable schedules, retries, and notifications.
Manages a Dash0 Synthetic Check. Synthetic checks periodically probe endpoints or URLs from multiple locations to monitor availability, latency, and correctness of your services. See Synthetic Monitoring and Manage Synthetic Checks as Code for more details.
Example Usage
terraform
resource "dash0_synthetic_check" "my_check" {
dataset = "default"
synthetic_check_yaml = file("${path.module}/synthetic_check.yaml")
}
# Creating notification channels with `for_each`, and linking one of them
# from a synthetic check.
#
# `dash0_notification_channel` exposes a computed `id` attribute (the
# server-assigned UUID, resolved by the provider after creation). The
# synthetic check references that id in `spec.notifications.channels`,
# which requires raw UUIDs rather than the `tf_`-prefixed origin.
resource "dash0_notification_channel" "team_oncall" {
for_each = {
backend = "backend-oncall@example.com"
frontend = "frontend-oncall@example.com"
sre = "sre-oncall@example.com"
}
notification_channel_yaml = <<-YAML
kind: Dash0NotificationChannel
metadata:
name: ${each.key} on-call
spec:
type: email_v2
config:
recipients:
- ${each.value}
plaintext: false
frequency: 10m
YAML
}
resource "dash0_synthetic_check" "checkout_api" {
dataset = "default"
synthetic_check_yaml = <<-YAML
kind: Dash0SyntheticCheck
metadata:
name: checkout-api
spec:
enabled: true
notifications:
channels:
- ${dash0_notification_channel.team_oncall["sre"].id}
plugin:
display:
name: checkout-api
kind: http
spec:
assertions:
criticalAssertions:
- kind: status_code
spec:
value: "200"
operator: is
request:
method: get
url: https://api.example.com/health
queryParameters: []
headers: []
redirects: follow
tls:
allowInsecure: false
tracing:
addTracingHeaders: true
retries:
kind: fixed
spec:
attempts: 3
delay: 1s
schedule:
interval: 1m
locations:
- de-frankfurt
- us-oregon
strategy: all_locations
YAML
}Schema
Required
synthetic_check_yaml(String) The synthetic check definition in YAML format, specifying the check type, target URL, schedule, and assertion criteria. See Create Synthetic Checks for the available options. Thedash0.com/sharingmetadata annotation is supported to control sharing settings; changes to it trigger a resource update. All other metadata annotations are managed by the server and ignored during drift detection.
Optional
dataset(String) The identifier of the Dash0 dataset that the synthetic check belongs to. Provide the dataset's identifier, which is immutable, not the 'name'. Datasets are used to separate observability data within a Dash0 organization. If omitted, the provider-leveldatasetdefault is used (see the provider'sdatasetattribute). Changing this value forces the resource to be recreated.
Read-Only
id(String) The server-assigned UUID of the synthetic check, resolved by the provider after creation. Reference this value when wiring the check's identifier into another resource (for example, a check rule that gates on the synthetic check's outcome).origin(String) A unique identifier for the synthetic check, automatically generated on creation. Used to reference the synthetic check for updates, reads, deletes, and imports.url(String) The URL to open this synthetic check in the Dash0 web app, derived from the Dash0 API URL and the synthetic check's server-assigned identifier. Computed by the provider after creation. May be empty if the app URL cannot be derived (e.g. for self-hosted deployments with a custom web app domain).
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
shell
#!/bin/bash
terraform import dash0_synthetic_check.name "{{ dataset }},{{ id_or_origin }}"