summary refs log tree commit diff
path: root/nixos/modules/services/monitoring/prometheus/default.nix
diff options
context:
space:
mode:
author0ida <0ida@users.noreply.github.com>2016-09-19 18:09:53 +0200
committeroida <oida@fnord.foo>2016-09-20 19:35:03 +0200
commit619ab48988bcd3dd8afc28ac5ee983d15d333fd2 (patch)
treed7841104051383724e60cd878ce3dbc056dab167 /nixos/modules/services/monitoring/prometheus/default.nix
parentfdded2c554633952700a2931d7c914dd1e47b493 (diff)
downloadnixlib-619ab48988bcd3dd8afc28ac5ee983d15d333fd2.tar
nixlib-619ab48988bcd3dd8afc28ac5ee983d15d333fd2.tar.gz
nixlib-619ab48988bcd3dd8afc28ac5ee983d15d333fd2.tar.bz2
nixlib-619ab48988bcd3dd8afc28ac5ee983d15d333fd2.tar.lz
nixlib-619ab48988bcd3dd8afc28ac5ee983d15d333fd2.tar.xz
nixlib-619ab48988bcd3dd8afc28ac5ee983d15d333fd2.tar.zst
nixlib-619ab48988bcd3dd8afc28ac5ee983d15d333fd2.zip
prometheus: add options for alertmanager
Diffstat (limited to 'nixos/modules/services/monitoring/prometheus/default.nix')
-rw-r--r--nixos/modules/services/monitoring/prometheus/default.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/default.nix b/nixos/modules/services/monitoring/prometheus/default.nix
index 31979d2660cc..e6817ee227ab 100644
--- a/nixos/modules/services/monitoring/prometheus/default.nix
+++ b/nixos/modules/services/monitoring/prometheus/default.nix
@@ -29,6 +29,9 @@ let
     "-storage.local.path=${cfg.dataDir}/metrics"
     "-config.file=${writePrettyJSON "prometheus.yml" promConfig}"
     "-web.listen-address=${cfg.listenAddress}"
+    "-alertmanager.notification-queue-capacity=${toString cfg.alertmanagerNotificationQueueCapacity}"
+    "-alertmanager.timeout=${toString cfg.alertmanagerTimeout}s"
+    (optionalString (cfg.alertmanagerURL != []) "-alertmanager.url=${concatStringsSep "," cfg.alertmanagerURL}")
   ];
 
   promTypes.globalConfig = types.submodule {
@@ -388,6 +391,30 @@ in {
           A list of scrape configurations.
         '';
       };
+
+      alertmanagerURL = mkOption {
+        type = types.listOf types.str;
+        default = [];
+        description = ''
+          List of Alertmanager URLs to send notifications to.
+        '';
+      };
+
+      alertmanagerNotificationQueueCapacity = mkOption {
+        type = types.int;
+        default = 10000;
+        description = ''
+          The capacity of the queue for pending alert manager notifications.
+        '';
+      };
+
+      alertmanagerTimeout = mkOption {
+        type = types.int;
+        default = 10;
+        description = ''
+          Alert manager HTTP API timeout (in seconds).
+        '';
+      };
     };
   };