summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorWilliButz <wbutz@cyberfnord.de>2018-05-01 14:34:28 +0200
committerRobin Gloster <mail@glob.in>2018-05-01 15:45:48 +0200
commitde60146f592feb6482a82fc27d9d01f713f34277 (patch)
tree6b929639193a357cd43b157d45313a80ad8ab7a8 /nixos
parent913ec8736c70a089e43a9ee3d8e1f639d01134f4 (diff)
downloadnixpkgs-de60146f592feb6482a82fc27d9d01f713f34277.tar
nixpkgs-de60146f592feb6482a82fc27d9d01f713f34277.tar.gz
nixpkgs-de60146f592feb6482a82fc27d9d01f713f34277.tar.bz2
nixpkgs-de60146f592feb6482a82fc27d9d01f713f34277.tar.lz
nixpkgs-de60146f592feb6482a82fc27d9d01f713f34277.tar.xz
nixpkgs-de60146f592feb6482a82fc27d9d01f713f34277.tar.zst
nixpkgs-de60146f592feb6482a82fc27d9d01f713f34277.zip
nixos/promtheus-nginx-exporter: update module
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/monitoring/prometheus/exporters/nginx.nix22
1 files changed, 19 insertions, 3 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/exporters/nginx.nix b/nixos/modules/services/monitoring/prometheus/exporters/nginx.nix
index 6a3ba2d0457..39054c2b73d 100644
--- a/nixos/modules/services/monitoring/prometheus/exporters/nginx.nix
+++ b/nixos/modules/services/monitoring/prometheus/exporters/nginx.nix
@@ -9,21 +9,37 @@ in
   port = 9113;
   extraOpts = {
     scrapeUri = mkOption {
-      type = types.string;
+      type = types.str;
       default = "http://localhost/nginx_status";
       description = ''
         Address to access the nginx status page.
         Can be enabled with services.nginx.statusPage = true.
       '';
     };
+    telemetryEndpoint = mkOption {
+      type = types.str;
+      default = "/metrics";
+      description = ''
+        Path under which to expose metrics.
+      '';
+    };
+    insecure = mkOption {
+      type = types.bool;
+      default = true;
+      description = ''
+        Ignore server certificate if using https.
+      '';
+    };
   };
   serviceOpts = {
     serviceConfig = {
       DynamicUser = true;
       ExecStart = ''
         ${pkgs.prometheus-nginx-exporter}/bin/nginx_exporter \
-          -nginx.scrape_uri '${cfg.scrapeUri}' \
-          -telemetry.address ${cfg.listenAddress}:${toString cfg.port} \
+          --nginx.scrape_uri '${cfg.scrapeUri}' \
+          --telemetry.address ${cfg.listenAddress}:${toString cfg.port} \
+          --telemetry.endpoint ${cfg.telemetryEndpoint} \
+          --insecure ${cfg.insecure} \
           ${concatStringsSep " \\\n  " cfg.extraFlags}
       '';
     };