summary refs log tree commit diff
path: root/nixos/modules/services/monitoring
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2017-10-25 18:21:46 +0200
committerFranz Pletz <fpletz@fnordicwalking.de>2017-10-25 20:10:20 +0200
commitce301ef21a90189fc5d7958a26a5447d486f422d (patch)
tree81c13157c3b60182f352840a4e15c8ff037aee96 /nixos/modules/services/monitoring
parent6667d021d5cc7e30e99acc2e1af6e63b82d7306f (diff)
downloadnixlib-ce301ef21a90189fc5d7958a26a5447d486f422d.tar
nixlib-ce301ef21a90189fc5d7958a26a5447d486f422d.tar.gz
nixlib-ce301ef21a90189fc5d7958a26a5447d486f422d.tar.bz2
nixlib-ce301ef21a90189fc5d7958a26a5447d486f422d.tar.lz
nixlib-ce301ef21a90189fc5d7958a26a5447d486f422d.tar.xz
nixlib-ce301ef21a90189fc5d7958a26a5447d486f422d.tar.zst
nixlib-ce301ef21a90189fc5d7958a26a5447d486f422d.zip
prometheus-node-exporter service: add disabledCollectors option
Diffstat (limited to 'nixos/modules/services/monitoring')
-rw-r--r--nixos/modules/services/monitoring/prometheus/node-exporter.nix12
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 d464ec8a7f54..908483037d12 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}
       '';