Add prometheus #118
2 changed files with 3 additions and 5 deletions
|
@ -36,7 +36,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
collecter_port = mkOption {
|
port_collecter = mkOption {
|
||||||
type = types.port;
|
type = types.port;
|
||||||
default = 9002;
|
default = 9002;
|
||||||
};
|
};
|
||||||
|
@ -48,7 +48,7 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
# most collectors are on by default see docs for more options
|
# most collectors are on by default see docs for more options
|
||||||
enabledCollectors = ["systemd"];
|
enabledCollectors = ["systemd"];
|
||||||
port = cfg.collecter_port;
|
port = cfg.port_collecter;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// mkIf cfg.server.enable {
|
// mkIf cfg.server.enable {
|
||||||
|
@ -60,7 +60,7 @@ in {
|
||||||
job_name = "node_exporter";
|
job_name = "node_exporter";
|
||||||
static_configs = [
|
static_configs = [
|
||||||
{
|
{
|
||||||
targets = (map (hostname: "${hostname}:${collecter_port}") (lib.attrsets.mapAttrsToList (server: server.deployment.hostname)) nodes) ++ cfg.other_nodes;
|
targets = (map (hostname: "${hostname}:${cfg.port_collecter}") (lib.attrsets.mapAttrsToList (server: server.deployment.hostname)) nodes) ++ cfg.other_nodes;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,8 +58,6 @@ in {
|
||||||
ip = ip_pub;
|
ip = ip_pub;
|
||||||
name = name;
|
name = name;
|
||||||
};
|
};
|
||||||
|
|
||||||
port = 9001;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue