From 619ab48988bcd3dd8afc28ac5ee983d15d333fd2 Mon Sep 17 00:00:00 2001 From: 0ida <0ida@users.noreply.github.com> Date: Mon, 19 Sep 2016 18:09:53 +0200 Subject: prometheus: add options for alertmanager --- .../services/monitoring/prometheus/default.nix | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'nixos/modules/services/monitoring') 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). + ''; + }; }; }; -- cgit 1.4.1