mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
prometheus: Split options listenAddress and port
Accessing the configured port of a service is quite useful, for example when configuring virtual hosts for a service. The prometheus module did not expose the configured por separately, making it unnecessarily cumbersome to consume. This is a breaking change only if you were setting `listenAddress` to a non-standard value. If you were, you should now set `listenAddress` and `port` separately.
This commit is contained in:
parent
59c9713715
commit
ba3c3de8a6
1 changed files with 10 additions and 2 deletions
|
@ -46,7 +46,7 @@ let
|
||||||
cmdlineArgs = cfg.extraFlags ++ [
|
cmdlineArgs = cfg.extraFlags ++ [
|
||||||
"--storage.tsdb.path=${workingDir}/data/"
|
"--storage.tsdb.path=${workingDir}/data/"
|
||||||
"--config.file=${prometheusYml}"
|
"--config.file=${prometheusYml}"
|
||||||
"--web.listen-address=${cfg.listenAddress}"
|
"--web.listen-address=${cfg.listenAddress}:${builtins.toString cfg.port}"
|
||||||
"--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"
|
||||||
] ++
|
] ++
|
||||||
|
@ -489,9 +489,17 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 9090;
|
||||||
|
description = ''
|
||||||
|
Port to listen on.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
listenAddress = mkOption {
|
listenAddress = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "0.0.0.0:9090";
|
default = "0.0.0.0";
|
||||||
description = ''
|
description = ''
|
||||||
Address to listen on for the web interface, API, and telemetry.
|
Address to listen on for the web interface, API, and telemetry.
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue