fix: some small fixes for prometheus
This commit is contained in:
parent
07cb42dd65
commit
8009b7c8d1
1 changed files with 13 additions and 3 deletions
|
@ -21,7 +21,7 @@ with lib; let
|
||||||
)
|
)
|
||||||
nodes
|
nodes
|
||||||
);
|
);
|
||||||
node = lib.attrsets.mapAttrsToList (key: value: "${value.config.deployment.targetHost}:${toString config.services.prometheus.exporters.node.port}") nodes;
|
node = lib.attrsets.mapAttrsToList (key: value: "${value.config.deployment.targetHost}:${toString value.config.services.prometheus.exporters.node.port}") nodes;
|
||||||
};
|
};
|
||||||
|
|
||||||
# clears any invalid entries
|
# clears any invalid entries
|
||||||
|
@ -37,8 +37,10 @@ in {
|
||||||
type = types.port;
|
type = types.port;
|
||||||
default = 9001;
|
default = 9001;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
external.node = mkOption {
|
external = {
|
||||||
|
node = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [];
|
default = [];
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -46,12 +48,20 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ports = {
|
||||||
|
node = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
default = 9100;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkMerge [
|
config = mkMerge [
|
||||||
{
|
{
|
||||||
services.prometheus.exporters.node = {
|
services.prometheus.exporters.node = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
port = cfg.ports.node;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
# most collectors are on by default see https://github.com/prometheus/node_exporter for more options
|
# most collectors are on by default see https://github.com/prometheus/node_exporter for more options
|
||||||
enabledCollectors = ["systemd" "processes"];
|
enabledCollectors = ["systemd" "processes"];
|
||||||
|
@ -66,7 +76,7 @@ in {
|
||||||
job_name = "node_exporter";
|
job_name = "node_exporter";
|
||||||
static_configs = [
|
static_configs = [
|
||||||
{
|
{
|
||||||
targets = filter_empty (exporters.node ++ cfg.server.external.node);
|
targets = filter_empty (exporters.node ++ cfg.external.node);
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue