diff options
author | Franz Pletz <fpletz@fnordicwalking.de> | 2017-10-25 18:21:46 +0200 |
---|---|---|
committer | Franz Pletz <fpletz@fnordicwalking.de> | 2017-10-25 20:10:20 +0200 |
commit | ce301ef21a90189fc5d7958a26a5447d486f422d (patch) | |
tree | 81c13157c3b60182f352840a4e15c8ff037aee96 /nixos | |
parent | 6667d021d5cc7e30e99acc2e1af6e63b82d7306f (diff) |
prometheus-node-exporter service: add disabledCollectors option
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/monitoring/prometheus/node-exporter.nix | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/node-exporter.nix b/nixos/modules/services/monitoring/prometheus/node-exporter.nix index d464ec8a7f542..908483037d127 100644 --- a/nixos/modules/services/monitoring/prometheus/node-exporter.nix +++ b/nixos/modules/services/monitoring/prometheus/node-exporter.nix @@ -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 = []; @@ -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} ''; |