Skip to content

Commit

Permalink
fix: fxing syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
JianLi-Expedia committed Nov 19, 2024
1 parent 4e33ff5 commit a2e7077
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions common.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,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)
}

data "aws_iam_account_alias" "current" {}
Expand Down
10 changes: 7 additions & 3 deletions templates.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ locals{
datadog_agent_version = var.datadog_agent_version
datadog_agent_enabled = var.datadog_agent_enabled
datadog_tags = local.datadog_tags
tcp_keepalive_time = var.tcp_keepalive_time
tcp_keepalive_intvl = var.tcp_keepalive_intvl
tcp_keepalive_probes = var.tcp_keepalive_probes
tcp_keepalive_time = var.tcp_keepalive_time
tcp_keepalive_intvl = var.tcp_keepalive_intvl
tcp_keepalive_probes = var.tcp_keepalive_probes
hms_metrics = local.hms_metrics
hms_metrics_type_overrides = local.hms_metrics_type_overrides
})

hms_readonly_template = templatefile("${path.module}/templates/apiary-hms-readonly.json", {
Expand Down Expand Up @@ -131,5 +133,7 @@ locals{
hms_readwrite_namespace = var.hms_readwrite_namespace
hms_readonly_namespace = var.hms_readonly_namespace
datadog_metrics_hms_readwrite_readonly = var.datadog_metrics_hms_readwrite_readonly
hms_metrics = local.hms_metrics
hms_metrics_type_overrides = local.hms_metrics_type_overrides
})
}
2 changes: 1 addition & 1 deletion templates/apiary-hms-readonly.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
}
},
"dockerLabels": {
"com.datadoghq.ad.instances": "[{ \"prometheus_url\": \"http://%%host%%:8080/actuator/prometheus\", \"namespace\": \"${hms_readonly_namespace}\", \"metrics\": [${join(\",\", ${datadog_metrics_hms_readwrite_readonly} )}] }]"
"com.datadoghq.ad.instances": "[{ \"prometheus_url\": \"http://%%host%%:8080/actuator/prometheus\", \"namespace\": \"${hms_readonly_namespace}\", \"metrics\": [\"${hms_metrics}\"],\"type_overrides\":{\"${hms_metrics_type_overrides}\": \"gauge\"} }]",
"com.datadoghq.ad.check_names": "[\"prometheus\"]",
"com.datadoghq.ad.init_configs": "[{}]"
},
Expand Down
2 changes: 1 addition & 1 deletion templates/apiary-hms-readwrite.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
}
},
"dockerLabels": {
"com.datadoghq.ad.instances": "[{ \"prometheus_url\": \"http://%%host%%:8080/actuator/prometheus\", \"namespace\": \"${hms_readwrite_namespace}\", \"metrics\": [${join(\",\", var.datadog_metrics_hms_readwrite_readonly)}] }]"
"com.datadoghq.ad.instances": "[{ \"prometheus_url\": \"http://%%host%%:8080/actuator/prometheus\", \"namespace\": \"${hms_readwrite_namespace}\", \"metrics\": [\"${hms_metrics}\"],\"type_overrides\":{\"${hms_metrics_type_overrides}\": \"gauge\"} }]",
"com.datadoghq.ad.check_names": "[\"prometheus\"]",
"com.datadoghq.ad.init_configs": "[{}]"
},
Expand Down

0 comments on commit a2e7077

Please sign in to comment.