feat(octoprint): metrics

This commit is contained in:
arcnmx 2024-07-13 14:08:37 -07:00
parent 1ead7f237e
commit 2c9219ba87
8 changed files with 91 additions and 18 deletions

View file

@ -22,7 +22,9 @@
portName,
}: let
port = service.ports.${portName};
in "${mkAddress6 (access.getAddressFor system.name "lan")}:${toString port.port}";
# TODO: this properly
getAddressFor = if port.status.gatus.client.network or "ip" == "ip4" then "getAddress4For" else "getAddressFor";
in "${mkAddress6 (access.${getAddressFor} system.name "lan")}:${toString port.port}";
mkServiceConfig = system: serviceName: let
inherit (service.prometheus) exporter;
service = system.exports.services.${serviceName};