Staging: tricot with metrics

This commit is contained in:
Alex 2022-12-05 23:42:53 +01:00
parent b260b01915
commit 27b23e15ec
Signed by untrusted user: lx
GPG key ID: 0E496D15096376BE
2 changed files with 19 additions and 1 deletions

View file

@ -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"
}
}
}
}

View file

@ -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