nixos/prometheus: get rid of empty arguments

Previously the prometheus.service file looked like:

  ExecStart=/nix/store/wjkhfw3xgkmavz1akkqir99w4lbqhak7-prometheus-1.8.2-bin/bin/prometheus -storage.local.path=/var/lib/prometheus/metrics \
    -config.file=/nix/store/zsnvzw51mk3n1cxjd0351bj39k1j6j27-prometheus.yml-check-config-checked \
    -web.listen-address=0.0.0.0:9090 \
    -alertmanager.notification-queue-capacity=10000 \
    -alertmanager.timeout=10s \
     \

  Restart=always

Now it's:

  ExecStart=/nix/store/wjkhfw3xgkmavz1akkqir99w4lbqhak7-prometheus-1.8.2-bin/bin/prometheus \
    -storage.local.path=/var/lib/prometheus/metrics \
    -config.file=/nix/store/zsnvzw51mk3n1cxjd0351bj39k1j6j27-prometheus.yml-check-config-checked \
    -web.listen-address=0.0.0.0:9090 \
    -alertmanager.notification-queue-capacity=10000 \
    -alertmanager.timeout=10s
  Restart=always
This commit is contained in:
Bas van Dijk 2019-04-08 13:55:36 +02:00 committed by Jean-Baptiste Giraudeau
parent a59c92903e
commit 7cf27feb2f
No known key found for this signature in database
GPG key ID: E96EF57FD501B961

View file

@ -57,9 +57,9 @@ let
"-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}")
(optionalString (cfg.webExternalUrl != null) "-web.external-url=${cfg.webExternalUrl}")
];
] ++
(optional (cfg.alertmanagerURL != []) "-alertmanager.url=${concatStringsSep "," cfg.alertmanagerURL}") ++
(optional (cfg.webExternalUrl != null) "-web.external-url=${cfg.webExternalUrl}");
# This becomes the main config file for Prometheus 2
promConfig2 = {
@ -91,8 +91,8 @@ let
"--web.listen-address=${cfg2.listenAddress}"
"--alertmanager.notification-queue-capacity=${toString cfg2.alertmanagerNotificationQueueCapacity}"
"--alertmanager.timeout=${toString cfg2.alertmanagerTimeout}s"
(optionalString (cfg2.webExternalUrl != null) "--web.external-url=${cfg2.webExternalUrl}")
];
] ++
(optional (cfg2.webExternalUrl != null) "--web.external-url=${cfg2.webExternalUrl}");
promTypes.globalConfig = types.submodule {
options = {