mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(octoprint): metrics
This commit is contained in:
parent
1ead7f237e
commit
2c9219ba87
8 changed files with 91 additions and 18 deletions
|
|
@ -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};
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ in {
|
|||
config.exports.services.octoprint = {config, ...}: {
|
||||
displayName = mkAlmostOptionDefault "OctoPrint";
|
||||
id = mkAlmostOptionDefault "print";
|
||||
prometheus.exporter.metricsPath = "/plugin/prometheus_exporter/metrics";
|
||||
nixos = {
|
||||
serviceAttr = "octoprint";
|
||||
assertions = let
|
||||
|
|
@ -33,6 +34,7 @@ in {
|
|||
enable = mkAlmostOptionDefault true;
|
||||
gatus.client.network = mkAlmostOptionDefault "ip4";
|
||||
};
|
||||
prometheus.exporter.enable = mkAlmostOptionDefault true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue