prometheus-node-exporter service: add disabledCollectors option
This commit is contained in:
parent
6667d021d5
commit
ce301ef21a
@ -37,6 +37,15 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
disabledCollectors = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [];
|
||||||
|
example = ''[ "timex" ]'';
|
||||||
|
description = ''
|
||||||
|
Collectors to disable which are enabled by default.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
extraFlags = mkOption {
|
extraFlags = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [];
|
default = [];
|
||||||
@ -64,7 +73,8 @@ in {
|
|||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
script = ''
|
script = ''
|
||||||
exec ${pkgs.prometheus-node-exporter}/bin/node_exporter \
|
exec ${pkgs.prometheus-node-exporter}/bin/node_exporter \
|
||||||
${concatMapStrings (x: "--collector." + x + " ") cfg.enabledCollectors} \
|
${concatMapStringsSep " " (x: "--collector." + x) cfg.enabledCollectors} \
|
||||||
|
${concatMapStringsSep " " (x: "--no-collector." + x) cfg.disabledCollectors} \
|
||||||
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
|
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
|
||||||
${concatStringsSep " \\\n " cfg.extraFlags}
|
${concatStringsSep " \\\n " cfg.extraFlags}
|
||||||
'';
|
'';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user