feat(monitoring): Enable node exporter on almost all nodes
This commit is contained in:
parent
8e79b19101
commit
c6fe6b5891
5 changed files with 69 additions and 1 deletions
|
@ -1,8 +1,26 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
config,
|
||||
nodes,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
host = "prometheus.dgnum.eu";
|
||||
port = 9091;
|
||||
|
||||
nodeExporterConfigs = lib.flatten (
|
||||
lib.mapAttrsToList (
|
||||
node:
|
||||
{ config, ... }:
|
||||
lib.optional config.dgn-node-monitoring.enable {
|
||||
targets = [ "${node}.dgnum:${builtins.toString config.dgn-node-monitoring.port}" ];
|
||||
labels = {
|
||||
host = node;
|
||||
};
|
||||
}
|
||||
) nodes
|
||||
);
|
||||
in
|
||||
|
||||
{
|
||||
|
@ -33,6 +51,10 @@ in
|
|||
job_name = "prometheus";
|
||||
static_configs = [ { targets = [ "localhost:9090" ]; } ];
|
||||
}
|
||||
{
|
||||
job_name = "node_exporter";
|
||||
static_configs = nodeExporterConfigs;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue