Skip to content

Commit

Permalink
prometheus-node-exporter service: add disabledCollectors option
Browse files Browse the repository at this point in the history
  • Loading branch information
fpletz committed Oct 25, 2017
1 parent 6667d02 commit ce301ef
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion nixos/modules/services/monitoring/prometheus/node-exporter.nix
Expand Up @@ -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 {
type = types.listOf types.str;
default = [];
Expand Down Expand Up @@ -64,7 +73,8 @@ in {
wantedBy = [ "multi-user.target" ];
script = ''
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} \
${concatStringsSep " \\\n " cfg.extraFlags}
'';
Expand Down

0 comments on commit ce301ef

Please sign in to comment.