Last updated:
dash0_signal_to_metrics
Manages a Dash0 Signal-to-Metrics rule. A signal-to-metrics rule turns the spans or logs that match its filter into metric data points at ingestion: it counts them, or records a number taken from each one as a sum, gauge, or exponential histogram. See Convert Signals to Metrics for the rule fields and their limits.
spec.enabled is required. The provider always sends a value for it, so an omitted field would silently create a disabled rule and later switch off one enabled elsewhere.
Deletes are soft: a destroyed rule stops producing metrics, and the API keeps a tombstone of it. Changing dataset destroys the rule and re-creates it under a new origin.
Example Usage
resource "dash0_signal_to_metrics" "checkout_errors" {
dataset = "default"
signal_to_metrics_yaml = file("${path.module}/signal_to_metrics.yaml")
}Schema
Required
signal_to_metrics_yaml(String) The signal-to-metrics rule definition in YAML format. The YAML must declarekind: Dash0SignalToMetrics, an explicitspec.enabled,spec.match(the source signal and its filters), andspec.output(the metric name and interval).spec.targetDatasetMode: originalis the default and is treated as equal to an omitted field. Thedash0.com/folder-pathanddash0.com/sharingmetadata annotations are supported, and changes to them trigger a resource update. Dash0 does not return them for signal-to-metrics rules yet, so a change made outside Terraform is detected only once it does, anddash0.com/sharinghas no effect on access for this resource type. The other server-managedmetadata.labelsandmetadata.annotationsare ignored, and any other label (such ascustom) or annotation is rejected, because the Dash0 API would drop it.
Optional
dataset(String) The identifier of the Dash0 dataset that the signal-to-metrics rule 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 under a new origin.
Read-Only
id(String) The server-assigned identifier of the signal-to-metrics rule, resolved by the provider after creation.origin(String) A unique identifier for the signal-to-metrics rule, automatically generated on creation. Used to reference the rule for updates, reads, deletes, and imports.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
#!/bin/bash
terraform import dash0_signal_to_metrics.checkout_errors default,tf_existing-signal-to-metrics-origin