synapse: generate metric endpoints automatically

This commit is contained in:
Oystein Kristoffer Tveit 2023-01-18 02:54:57 +01:00
parent e590e54862
commit c8d26e3c81
Signed by untrusted user: oysteikt
GPG Key ID: 9F2F7D8250F35146

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"