From 9c14b3cc7b33cbd864422e3bf9454722ae060508 Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 28 Aug 2024 23:52:51 +0200 Subject: Fix synapse metrics --- modules/monitoring/synapse.nix | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/modules/monitoring/synapse.nix b/modules/monitoring/synapse.nix index 0271108..1d26f0e 100644 --- a/modules/monitoring/synapse.nix +++ b/modules/monitoring/synapse.nix @@ -4,17 +4,12 @@ let in { config = lib.mkIf (cfg.monitorAll && config.services.matrix-synapse.enable) { + services.matrix-synapse.settings.enable_metrics = true; services.matrix-synapse.settings.listeners = [ { - type = "http"; + type = "metrics"; port = 9200; tls = false; - resources = [ - { - names = [ "metrics" ]; - compress = false; - } - ]; } ]; @@ -58,14 +53,8 @@ in value = { worker_listeners = [ { - type = "http"; + type = "metrics"; port = 9200 + index + 1; - resources = [ - { - names = [ "metrics" ]; - compress = false; - } - ]; } ]; }; @@ -78,6 +67,7 @@ in job_name = "synapse-main-${toString interval}s"; scrape_interval = "${toString interval}s"; static_configs = [ { targets = [ "localhost:9200" ]; } ]; + metrics_path = "_synapse/metrics"; }) cfg.prometheusScrapeIntervals) ++ lib.flatten ( lib.imap ( @@ -86,6 +76,7 @@ in job_name = "synapse-${workerName}-${toString interval}s"; scrape_interval = "${toString interval}s"; static_configs = [ { targets = [ "localhost:${toString (9200 + index + 1)}" ]; } ]; + metrics_path = "_synapse/metrics"; }) cfg.prometheusScrapeIntervals ) config.monitoring.synapse.workerNames ) -- cgit 1.4.1