diff --git a/metrics/metrics.tf b/metrics/metrics.tf index 8cc5037..ff198c0 100644 --- a/metrics/metrics.tf +++ b/metrics/metrics.tf @@ -21,6 +21,7 @@ resource "nomad_job" "prometheus" { hcl2 { enabled = true vars = { + # TODO: May not need this because we have an env variable for that # "consul_address" = "${var.consul_address}", # TODO: Should this be a list? "consul_address" = "http://${data.consul_nodes.all-nodes.nodes[0].address}:8500", diff --git a/metrics/prometheus.nomad b/metrics/prometheus.nomad index 7b5faaa..ea86af7 100644 --- a/metrics/prometheus.nomad +++ b/metrics/prometheus.nomad @@ -97,7 +97,8 @@ scrape_configs: format: - "prometheus" consul_sd_configs: - - server: "${var.consul_address}" + # - server: "${var.consul_address}" + - server: "${CONSUL_HTTP_ADDR}" services: - "nomad" tags: @@ -109,7 +110,8 @@ scrape_configs: format: - "prometheus" consul_sd_configs: - - server: "${var.consul_address}" + # - server: "${var.consul_address}" + - server: "${CONSUL_HTTP_ADDR}" services: - "nomad-client" @@ -119,7 +121,8 @@ scrape_configs: format: - "prometheus" consul_sd_configs: - - server: "${var.consul_address}" + # - server: "${var.consul_address}" + - server: "${CONSUL_HTTP_ADDR}" services: - "consul" relabel_configs: @@ -130,7 +133,8 @@ scrape_configs: - job_name: "exporters" metrics_path: "/metrics" consul_sd_configs: - - server: "${var.consul_address}" + # - server: "${var.consul_address}" + - server: "${CONSUL_HTTP_ADDR}" relabel_configs: - source_labels: [__meta_consul_service] action: drop @@ -152,7 +156,8 @@ scrape_configs: - job_name: "envoy" metrics_path: "/metrics" consul_sd_configs: - - server: "${var.consul_address}" + # - server: "${var.consul_address}" + - server: "${CONSUL_HTTP_ADDR}" relabel_configs: - source_labels: [__meta_consul_service] action: keep