2024-06-09 18:04:14 +00:00
|
|
|
{config, lib, ...}: let
|
|
|
|
cfg = config.selfprivacy.modules.monitoring;
|
|
|
|
in {
|
|
|
|
options.selfprivacy.modules.monitoring = {
|
|
|
|
enable = lib.mkOption {
|
|
|
|
default = false;
|
|
|
|
type = lib.types.bool;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
services.prometheus = {
|
|
|
|
enable = true;
|
|
|
|
port = 9001;
|
2024-06-17 18:42:49 +00:00
|
|
|
listenAddress = "127.0.0.1";
|
2024-06-09 18:04:14 +00:00
|
|
|
exporters = {
|
|
|
|
node = {
|
|
|
|
enable = true;
|
|
|
|
enabledCollectors = [ "systemd" ];
|
|
|
|
port = 9002;
|
2024-06-18 18:30:02 +00:00
|
|
|
listenAddress = "127.0.0.1";
|
2024-06-09 18:04:14 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
scrapeConfigs = [
|
|
|
|
{
|
|
|
|
job_name = "node-exporter";
|
|
|
|
static_configs = [{
|
|
|
|
targets = [ "127.0.0.1:9002" ];
|
|
|
|
}];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|