From 84d69570f0d23c697f919614102c7a1acaca5313 Mon Sep 17 00:00:00 2001 From: Abhinav Krishna C K Date: Mon, 16 Dec 2024 18:23:24 +0530 Subject: [PATCH] Enable prometheus metrics support consul+nomad --- 4-nomad/shared/config/consul.hcl | 7 ++++++- 4-nomad/shared/config/consul_client.hcl | 7 ++++++- 4-nomad/shared/config/nomad.hcl | 8 ++++++++ 4-nomad/shared/config/nomad_client.hcl | 9 +++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/4-nomad/shared/config/consul.hcl b/4-nomad/shared/config/consul.hcl index 9bea26e..4a79498 100644 --- a/4-nomad/shared/config/consul.hcl +++ b/4-nomad/shared/config/consul.hcl @@ -26,4 +26,9 @@ ports { connect { enabled = true -} \ No newline at end of file +} + +telemetry { + prometheus_retention_time = "24h" + disable_hostname = true +} diff --git a/4-nomad/shared/config/consul_client.hcl b/4-nomad/shared/config/consul_client.hcl index ce4d008..572881a 100644 --- a/4-nomad/shared/config/consul_client.hcl +++ b/4-nomad/shared/config/consul_client.hcl @@ -12,4 +12,9 @@ acl { ports { grpc = 8502 -} \ No newline at end of file +} + +telemetry { + prometheus_retention_time = "24h" + disable_hostname = true +} diff --git a/4-nomad/shared/config/nomad.hcl b/4-nomad/shared/config/nomad.hcl index 0787d4c..0e60d1f 100644 --- a/4-nomad/shared/config/nomad.hcl +++ b/4-nomad/shared/config/nomad.hcl @@ -21,3 +21,11 @@ vault { token = "VAULT_TOKEN" } +# Enable metrics collection +telemetry { + collection_interval = "1s" + disable_hostname = true + prometheus_metrics = true + publish_allocation_metrics = true + publish_node_metrics = true +} diff --git a/4-nomad/shared/config/nomad_client.hcl b/4-nomad/shared/config/nomad_client.hcl index 13062bd..ccacde7 100644 --- a/4-nomad/shared/config/nomad_client.hcl +++ b/4-nomad/shared/config/nomad_client.hcl @@ -26,3 +26,12 @@ vault { enabled = true address = "http://active.vault.service.consul:8200" } + +# Enable metrics collection +telemetry { + collection_interval = "1s" + disable_hostname = true + prometheus_metrics = true + publish_allocation_metrics = true + publish_node_metrics = true +} \ No newline at end of file