aboutsummaryrefslogtreecommitdiff
path: root/cluster/staging/app
diff options
context:
space:
mode:
authorArmaël Guéneau <armael.gueneau@ens-lyon.org>2024-11-10 15:45:35 +0100
committerArmaël Guéneau <armael.gueneau@ens-lyon.org>2024-11-10 15:45:35 +0100
commite5cc0db639ca6c47c29b334af55e2ace6bd009ea (patch)
tree9975e8f5c641ec57e8f04dcc71695f647a5aef40 /cluster/staging/app
parentfe7725b49ec55e170967ba74a488422bb8a1b243 (diff)
downloadnixcfg-e5cc0db639ca6c47c29b334af55e2ace6bd009ea.tar.gz
nixcfg-e5cc0db639ca6c47c29b334af55e2ace6bd009ea.zip
staging: enable telemetry for nomad allocations
Diffstat (limited to 'cluster/staging/app')
-rw-r--r--cluster/staging/app/telemetry/config/prometheus.yml24
-rw-r--r--cluster/staging/app/telemetry/deploy/telemetry-service.hcl15
2 files changed, 39 insertions, 0 deletions
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