summary refs log tree commit diff
path: root/modules/monitoring
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-08-28 23:52:51 +0200
committerRory& <root@rory.gay>2024-08-28 23:52:51 +0200
commit9c14b3cc7b33cbd864422e3bf9454722ae060508 (patch)
treec8a9266d9cd80d0985e8758557372f1decd28e04 /modules/monitoring
parentServer changes (diff)
downloadRory-Open-Architecture-9c14b3cc7b33cbd864422e3bf9454722ae060508.tar.xz
Fix synapse metrics
Diffstat (limited to 'modules/monitoring')
-rw-r--r--modules/monitoring/synapse.nix19
1 files 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
       )