about summary refs log tree commit diff
path: root/nixos/modules/services/monitoring
diff options
context:
space:
mode:
authorWilliButz <WilliButz@users.noreply.github.com>2020-03-02 20:48:40 +0100
committerGitHub <noreply@github.com>2020-03-02 14:48:40 -0500
commiteaef96093a30175159444b2328ea732d06671e4d (patch)
treed6bd98990d5662d980796630ca5b8400d9b5c0b0 /nixos/modules/services/monitoring
parentfa4534f75b9e694d8917c5fc5383ca74c3965c99 (diff)
downloadnixlib-eaef96093a30175159444b2328ea732d06671e4d.tar
nixlib-eaef96093a30175159444b2328ea732d06671e4d.tar.gz
nixlib-eaef96093a30175159444b2328ea732d06671e4d.tar.bz2
nixlib-eaef96093a30175159444b2328ea732d06671e4d.tar.lz
nixlib-eaef96093a30175159444b2328ea732d06671e4d.tar.xz
nixlib-eaef96093a30175159444b2328ea732d06671e4d.tar.zst
nixlib-eaef96093a30175159444b2328ea732d06671e4d.zip
prometheus-nginx-exporter: 0.5.0 -> 0.6.0 (#81285)
* prometheus-nginx-exporter: 0.5.0 -> 0.6.0

* nixos/prometheus-nginx-exporter: update for 0.6.0

Added new option constLabels and updated virtualHost name in the
exporter's test.
Diffstat (limited to 'nixos/modules/services/monitoring')
-rw-r--r--nixos/modules/services/monitoring/prometheus/exporters/nginx.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/exporters/nginx.nix b/nixos/modules/services/monitoring/prometheus/exporters/nginx.nix
index ba852fea4336..56cddfc55b71 100644
--- a/nixos/modules/services/monitoring/prometheus/exporters/nginx.nix
+++ b/nixos/modules/services/monitoring/prometheus/exporters/nginx.nix
@@ -30,7 +30,17 @@ in
         Whether to perform certificate verification for https.
       '';
     };
-
+    constLabels = mkOption {
+      type = types.listOf types.str;
+      default = [];
+      example = [
+        "label1=value1"
+        "label2=value2"
+      ];
+      description = ''
+        A list of constant labels that will be used in every metric.
+      '';
+    };
   };
   serviceOpts = {
     serviceConfig = {
@@ -40,6 +50,7 @@ in
           --nginx.ssl-verify ${toString cfg.sslVerify} \
           --web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
           --web.telemetry-path ${cfg.telemetryPath} \
+          --prometheus.const-labels ${concatStringsSep "," cfg.constLabels} \
           ${concatStringsSep " \\\n  " cfg.extraFlags}
       '';
     };