From c8d26e3c811f706f0909176111e68082ce5fb92e Mon Sep 17 00:00:00 2001 From: h7x4 Date: Wed, 18 Jan 2023 02:54:57 +0100 Subject: [PATCH] synapse: generate metric endpoints automatically --- hosts/jokum/services/matrix/synapse.nix | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/hosts/jokum/services/matrix/synapse.nix b/hosts/jokum/services/matrix/synapse.nix index 7709a6f..f8682ea 100644 --- a/hosts/jokum/services/matrix/synapse.nix +++ b/hosts/jokum/services/matrix/synapse.nix @@ -206,15 +206,10 @@ in { }; locations."/metrics/" = let - endpoints = builtins.map (x: "matrix.pvv.ntnu.no/metrics/${x}") [ - "master/1" - "fed-sender/1" - "fed-sender/2" - "fed-receiver/1" - "initial-sync/1" - "normal-sync/1" - "event-persist/1" - "user-dir/1" + endpoints = lib.pipe cfg.workers.instances [ + (lib.mapAttrsToList (_: v: v)) + (map (w: "${w.type}/${toString w.index}")) + (map (w: "matrix.pvv.ntnu.no/metrics/${w}")) ]; in { alias = pkgs.writeTextDir "/config.json"