synapse: generate metric endpoints automatically

This commit is contained in:
h7x4 2023-01-18 02:54:57 +01:00
parent e590e54862
commit c8d26e3c81
No known key found for this signature in database
GPG Key ID: 9F2F7D8250F35146
1 changed files with 4 additions and 9 deletions

View File

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