diff --git a/common.tf b/common.tf index 34c398c..3b058cc 100644 --- a/common.tf +++ b/common.tf @@ -62,8 +62,8 @@ locals { ro_ingress_cidr = var.ingress_cidr rw_ingress_cidr = length(var.rw_ingress_cidr) == 0 ? var.ingress_cidr : var.rw_ingress_cidr - hms_metrics = join("\",\"", var.datadog_metrics_hms_readwrite_readonly) - hms_metrics_type_overrides = join("\": \"gauge\",\"", var.datadog_metrics_hms_readwrite_readonly) + hms_metrics = join("\\\",\\\"", var.datadog_metrics_hms_readwrite_readonly) + hms_metrics_type_overrides = join("\\\": \\\"gauge\\\",\\\"", var.datadog_metrics_hms_readwrite_readonly) } data "aws_iam_account_alias" "current" {} diff --git a/templates/apiary-hms-readonly.json b/templates/apiary-hms-readonly.json index 1fc27cf..ea7a36b 100644 --- a/templates/apiary-hms-readonly.json +++ b/templates/apiary-hms-readonly.json @@ -75,9 +75,9 @@ } }, "dockerLabels": { - "com.datadoghq.ad.instances": '[{ "prometheus_url": "http://%%host%%:8080/actuator/prometheus", "namespace": "${hms_metrics_namespace}", "metrics": ["${hms_metrics}"],"type_overrides":{"${hms_metrics_type_overrides}": "gauge"} }]', - "com.datadoghq.ad.check_names": '["prometheus"]', - "com.datadoghq.ad.init_configs": '[{}]' + "com.datadoghq.ad.instances": "[{ \"prometheus_url\": \"http://%%host%%:8080/actuator/prometheus\", \"namespace\": \"${hms_metrics_namespace}\", \"metrics\": [\"${hms_metrics}\"],\"type_overrides\":{\"${hms_metrics_type_overrides}\": \"gauge\"} }]", + "com.datadoghq.ad.check_names": "[\"prometheus\"]", + "com.datadoghq.ad.init_configs": "[{}]" }, "portMappings": [ { diff --git a/templates/apiary-hms-readwrite.json b/templates/apiary-hms-readwrite.json index b215367..64220d2 100644 --- a/templates/apiary-hms-readwrite.json +++ b/templates/apiary-hms-readwrite.json @@ -75,9 +75,9 @@ } }, "dockerLabels": { - "com.datadoghq.ad.instances": '[{ "prometheus_url": "http://%%host%%:8080/actuator/prometheus", "namespace": "${hms_metrics_namespace}", "metrics": ["${hms_metrics}"],"type_overrides":{"${hms_metrics_type_overrides}": "gauge"} }]', - "com.datadoghq.ad.check_names": '["prometheus"]', - "com.datadoghq.ad.init_configs": '[{}]' + "com.datadoghq.ad.instances": "[{ \"prometheus_url\": \"http://%%host%%:8080/actuator/prometheus\", \"namespace\": \"${hms_metrics_namespace}\", \"metrics\": [\"${hms_metrics}\"],\"type_overrides\":{\"${hms_metrics_type_overrides}\": \"gauge\"} }]", + "com.datadoghq.ad.check_names": "[\"prometheus\"]", + "com.datadoghq.ad.init_configs": "[{}]" }, "portMappings": [ {