From e5cc0db639ca6c47c29b334af55e2ace6bd009ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arma=C3=ABl=20Gu=C3=A9neau?= Date: Sun, 10 Nov 2024 15:45:35 +0100 Subject: staging: enable telemetry for nomad allocations --- .../staging/app/telemetry/config/prometheus.yml | 24 ++++++++++++++++++++++ .../app/telemetry/deploy/telemetry-service.hcl | 15 ++++++++++++++ 2 files changed, 39 insertions(+) (limited to 'cluster') diff --git a/cluster/staging/app/telemetry/config/prometheus.yml b/cluster/staging/app/telemetry/config/prometheus.yml index 75c87a0..5745a5c 100644 --- a/cluster/staging/app/telemetry/config/prometheus.yml +++ b/cluster/staging/app/telemetry/config/prometheus.yml @@ -38,3 +38,27 @@ scrape_configs: ca_file: /etc/prom/consul.crt cert_file: /etc/prom/consul-client.crt key_file: /etc/prom/consul-client.key + + # see https://prometheus.io/docs/prometheus/latest/configuration/configuration/#static_config + # and https://www.nomadproject.io/api-docs/metrics + # and https://learn.hashicorp.com/tutorials/nomad/prometheus-metrics + # dashboard at https://grafana.com/grafana/dashboards/3800 + - job_name: 'nomad' + scrape_interval: 10s + metrics_path: "/v1/metrics" + params: + format: ['prometheus'] + scheme: 'https' + tls_config: + ca_file: /etc/prom/nomad-ca.crt + cert_file: /etc/prom/nomad-client.crt + key_file: /etc/prom/nomad-client.key + insecure_skip_verify: true + consul_sd_configs: + - server: 'https://localhost:8501' + services: + - 'nomad-client' + tls_config: + ca_file: /etc/prom/consul.crt + cert_file: /etc/prom/consul-client.crt + key_file: /etc/prom/consul-client.key diff --git a/cluster/staging/app/telemetry/deploy/telemetry-service.hcl b/cluster/staging/app/telemetry/deploy/telemetry-service.hcl index 99af2a4..47554e2 100644 --- a/cluster/staging/app/telemetry/deploy/telemetry-service.hcl +++ b/cluster/staging/app/telemetry/deploy/telemetry-service.hcl @@ -53,6 +53,21 @@ job "telemetry-service" { destination = "etc/prom/consul-client.key" } + template { + data = "{{ key \"secrets/nomad/nomad-ca.crt\" }}" + destination = "etc/prom/nomad-ca.crt" + } + + template { + data = "{{ key \"secrets/nomad/nomad-client.crt\" }}" + destination = "etc/prom/nomad-client.crt" + } + + template { + data = "{{ key \"secrets/nomad/nomad-client.key\" }}" + destination = "etc/prom/nomad-client.key" + } + resources { memory = 500 cpu = 200 -- cgit v1.2.3