From 27b23e15ec6106969fc9bc18b311b23aeac8cc9b Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 5 Dec 2022 23:42:53 +0100 Subject: [PATCH] Staging: tricot with metrics --- .../staging/app/frontend/deploy/frontend-tricot.hcl | 10 +++++++++- cluster/staging/app/telemetry/config/prometheus.yml | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/cluster/staging/app/frontend/deploy/frontend-tricot.hcl b/cluster/staging/app/frontend/deploy/frontend-tricot.hcl index 30ee599..ae46d4a 100644 --- a/cluster/staging/app/frontend/deploy/frontend-tricot.hcl +++ b/cluster/staging/app/frontend/deploy/frontend-tricot.hcl @@ -12,6 +12,7 @@ job "frontend" { network { port "http_port" { static = 80 } port "https_port" { static = 443 } + port "metrics_port" { static = 8334 } } task "server" { @@ -19,7 +20,7 @@ job "frontend" { config { packages = [ - "git+https://git.deuxfleurs.fr/Deuxfleurs/tricot.git?ref=main&rev=0ae7f5fbd924a293dcd3f1b6b61fc3cc46bd3876" + "git+https://git.deuxfleurs.fr/Deuxfleurs/tricot.git?ref=main&rev=ba5bf133f61c3a56728c2ab73e11abf47ef8348c" ] command = "tricot" # cap_add = [ "net_bind_service" ] # this doesn't work for whatever reason, so we need to put user = "root" instead @@ -64,6 +65,7 @@ TRICOT_CONSUL_CLIENT_CERT=/etc/tricot/consul-client.crt TRICOT_CONSUL_CLIENT_KEY=/etc/tricot/consul-client.key TRICOT_HTTP_BIND_ADDR=[::]:80 TRICOT_HTTPS_BIND_ADDR=[::]:443 +TRICOT_METRICS_BIND_ADDR=[::]:8334 RUST_LOG=tricot=debug EOH destination = "secrets/env" @@ -83,6 +85,12 @@ EOH /* tags = [ "(diplonat (tcp_port 443))" ] */ address_mode = "host" } + + service { + name = "tricot-metrics" + port = "metrics_port" + address_mode = "host" + } } } } diff --git a/cluster/staging/app/telemetry/config/prometheus.yml b/cluster/staging/app/telemetry/config/prometheus.yml index 0203ca4..75c87a0 100644 --- a/cluster/staging/app/telemetry/config/prometheus.yml +++ b/cluster/staging/app/telemetry/config/prometheus.yml @@ -28,3 +28,13 @@ scrape_configs: ca_file: /etc/prom/consul.crt cert_file: /etc/prom/consul-client.crt key_file: /etc/prom/consul-client.key + + - job_name: 'tricot' + consul_sd_configs: + - server: 'https://localhost:8501' + services: + - 'tricot-metrics' + tls_config: + ca_file: /etc/prom/consul.crt + cert_file: /etc/prom/consul-client.crt + key_file: /etc/prom/consul-client.key