nixos/prometheus: add webExternalUrl option

Similar to the prometheus.alertmanager.webExternalUrl option, but for
Prometheus itself.
This commit is contained in:
Pierre Bourdon 2018-10-20 04:40:11 +02:00 committed by Robin Gloster
parent 7a10601dc4
commit cf58856d90

View File

@ -39,6 +39,7 @@ let
"-alertmanager.notification-queue-capacity=${toString cfg.alertmanagerNotificationQueueCapacity}" "-alertmanager.notification-queue-capacity=${toString cfg.alertmanagerNotificationQueueCapacity}"
"-alertmanager.timeout=${toString cfg.alertmanagerTimeout}s" "-alertmanager.timeout=${toString cfg.alertmanagerTimeout}s"
(optionalString (cfg.alertmanagerURL != []) "-alertmanager.url=${concatStringsSep "," cfg.alertmanagerURL}") (optionalString (cfg.alertmanagerURL != []) "-alertmanager.url=${concatStringsSep "," cfg.alertmanagerURL}")
(optionalString (cfg.webExternalUrl != null) "-web.external-url=${cfg.webExternalUrl}")
]; ];
promTypes.globalConfig = types.submodule { promTypes.globalConfig = types.submodule {
@ -467,6 +468,16 @@ in {
Alert manager HTTP API timeout (in seconds). Alert manager HTTP API timeout (in seconds).
''; '';
}; };
webExternalUrl = mkOption {
type = types.nullOr types.str;
default = null;
example = "https://example.com/";
description = ''
The URL under which Prometheus is externally reachable (for example,
if Prometheus is served via a reverse proxy).
'';
};
}; };
}; };