From de60146f592feb6482a82fc27d9d01f713f34277 Mon Sep 17 00:00:00 2001 From: WilliButz Date: Tue, 1 May 2018 14:34:28 +0200 Subject: [PATCH] nixos/promtheus-nginx-exporter: update module --- .../monitoring/prometheus/exporters/nginx.nix | 22 ++++++++++++++++--- 1 file 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} ''; };