From 633e0a9a24d1d0cd10b59127cc86e361be877bd6 Mon Sep 17 00:00:00 2001 From: tyler Date: Wed, 27 Sep 2023 18:03:30 +0000 Subject: [PATCH 1/2] Add optional "type" key to var.datadog_metrics_mdatadata --- terraform/variables.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/variables.tf b/terraform/variables.tf index a761d1ce..f6822d60 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -177,6 +177,7 @@ variable "datadog_metrics_metadata" { type = map(object({ short_name = optional(string) description = optional(string) + type = optional(string) # https://docs.datadoghq.com/metrics/types/ (default: "gauge") unit = optional(string) # https://docs.datadoghq.com/metrics/units/ per_unit = optional(string) })) From 3172b19dbc97ae36e84dec4155f7756507e5656f Mon Sep 17 00:00:00 2001 From: tyler Date: Wed, 27 Sep 2023 18:05:03 +0000 Subject: [PATCH 2/2] Default metric type to "gauge" when undefined --- terraform/datadog_metrics.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/datadog_metrics.tf b/terraform/datadog_metrics.tf index c2aaa780..4ed950d1 100644 --- a/terraform/datadog_metrics.tf +++ b/terraform/datadog_metrics.tf @@ -39,6 +39,7 @@ resource "datadog_metric_metadata" "custom" { metric = each.key short_name = each.value.short_name description = each.value.description + type = coalesce(each.value.type, "gauge") unit = each.value.unit per_unit = each.value.per_unit