nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/kea.nix
Martin Weinelt c77d192eb4
prometheus-kea-exporter: 0.6.1 -> 0.7.0
https://github.com/mweinelt/kea-exporter/blob/v0.7.0/HISTORY

Updates the module to use the target name, because it now supports both
UDS as well as HTTP URLs.
2024-03-21 06:17:59 +01:00

54 lines
1.1 KiB
Nix

{ config
, lib
, pkgs
, utils
, ...
}:
with lib;
let
cfg = config.services.prometheus.exporters.kea;
in {
imports = [
(mkRenamedOptionModule [ "controlSocketPaths" ] [ "targets" ])
];
port = 9547;
extraOpts = {
targets = mkOption {
type = types.listOf types.str;
example = literalExpression ''
[
"/run/kea/kea-dhcp4.socket"
"/run/kea/kea-dhcp6.socket"
"http://127.0.0.1:8547"
]
'';
description = lib.mdDoc ''
Paths or URLs to the Kea control socket.
'';
};
};
serviceOpts = {
after = [
"kea-dhcp4-server.service"
"kea-dhcp6-server.service"
];
serviceConfig = {
User = "kea";
DynamicUser = true;
ExecStart = utils.escapeSystemdExecArgs ([
(lib.getExe pkgs.prometheus-kea-exporter)
"--address" cfg.listenAddress
"--port" cfg.port
] ++ cfg.extraFlags ++ cfg.targets);
RuntimeDirectory = "kea";
RuntimeDirectoryPreserve = true;
RestrictAddressFamilies = [
# Need AF_UNIX to collect data
"AF_UNIX"
];
};
};
}