AutoMerge is generally available

Last updated:

dash0_signal_to_metrics

Terraform resource for Dash0 signal-to-metrics rules that turn matching spans and logs into metrics at ingestion.

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.

Note

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

terraform
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 declare kind: Dash0SignalToMetrics, an explicit spec.enabled, spec.match (the source signal and its filters), and spec.output (the metric name and interval). spec.targetDatasetMode: original is the default and is treated as equal to an omitted field. The dash0.com/folder-path and dash0.com/sharing metadata 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, and dash0.com/sharing has no effect on access for this resource type. The other server-managed metadata.labels and metadata.annotations are ignored, and any other label (such as custom) 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-level dataset default is used (see the provider's dataset attribute). 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:

shell
#!/bin/bash
terraform import dash0_signal_to_metrics.checkout_errors default,tf_existing-signal-to-metrics-origin