aboutsummaryrefslogtreecommitdiff
path: root/cluster/prod/app
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-12-06 14:41:53 +0100
committerAlex Auvolat <alex@adnab.me>2022-12-06 14:41:53 +0100
commit6036f5a1b7f648cbd84dd4f698811d8aa0e2dd50 (patch)
treefde129edfd1d2e1e7a8358e4bee58186b7edab53 /cluster/prod/app
parente1ddb2d1d37a404d1fb33e65ea935212e91cf40a (diff)
downloadnixcfg-6036f5a1b7f648cbd84dd4f698811d8aa0e2dd50.tar.gz
nixcfg-6036f5a1b7f648cbd84dd4f698811d8aa0e2dd50.zip
deploy tricot metrics on production
Diffstat (limited to 'cluster/prod/app')
-rw-r--r--cluster/prod/app/core/deploy/core.hcl12
-rw-r--r--cluster/prod/app/telemetry/config/prometheus.yml10
2 files changed, 20 insertions, 2 deletions
diff --git a/cluster/prod/app/core/deploy/core.hcl b/cluster/prod/app/core/deploy/core.hcl
index 43966b7..c1331f3 100644
--- a/cluster/prod/app/core/deploy/core.hcl
+++ b/cluster/prod/app/core/deploy/core.hcl
@@ -75,13 +75,14 @@ EOH
network {
port "http_port" { static = 80 }
port "https_port" { static = 443 }
+ port "metrics_port" { static = 9334 }
}
task "server" {
driver = "docker"
config {
- image = "lxpz/amd64_tricot:42"
+ image = "lxpz/amd64_tricot:44"
network_mode = "host"
readonly_rootfs = true
ports = [ "http_port", "https_port" ]
@@ -91,7 +92,7 @@ EOH
}
resources {
- cpu = 500
+ cpu = 1000
memory = 200
memory_max = 500
}
@@ -129,6 +130,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=[::]:9334
RUST_LOG=tricot=debug
EOH
destination = "secrets/env"
@@ -148,6 +150,12 @@ EOH
tags = [ "(diplonat (tcp_port 443))", "${meta.site}" ]
address_mode = "host"
}
+
+ service {
+ name = "tricot-metrics"
+ port = "metrics_port"
+ address_mode = "host"
+ }
}
}
diff --git a/cluster/prod/app/telemetry/config/prometheus.yml b/cluster/prod/app/telemetry/config/prometheus.yml
index a52b64d..6525513 100644
--- a/cluster/prod/app/telemetry/config/prometheus.yml
+++ b/cluster/prod/app/telemetry/config/prometheus.yml
@@ -16,6 +16,16 @@ scrape_configs:
cert_file: /etc/prometheus/consul-client.crt
key_file: /etc/prometheus/consul-client.key
+ - job_name: 'tricot'
+ consul_sd_configs:
+ - server: 'https://localhost:8501'
+ services:
+ - 'tricot-metrics'
+ tls_config:
+ ca_file: /etc/prometheus/consul.crt
+ cert_file: /etc/prometheus/consul-client.crt
+ key_file: /etc/prometheus/consul-client.key
+
- job_name: 'garage'
authorization:
type: Bearer