nixos/prometheus-nginx-exporter: update module

Update exporter submodule to match the new exporter version.
This commit is contained in:
WilliButz 2019-07-17 14:36:37 +02:00
parent 86c884fb5b
commit c64f621bfd
No known key found for this signature in database
GPG Key ID: 92582A10F1179CB2
1 changed files with 16 additions and 8 deletions

View File

@ -16,32 +16,40 @@ in
Can be enabled with services.nginx.statusPage = true.
'';
};
telemetryEndpoint = mkOption {
telemetryPath = mkOption {
type = types.str;
default = "/metrics";
description = ''
Path under which to expose metrics.
'';
};
insecure = mkOption {
sslVerify = mkOption {
type = types.bool;
default = true;
description = ''
Ignore server certificate if using https.
Whether to perform certificate verification for 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} \
--telemetry.endpoint ${cfg.telemetryEndpoint} \
--insecure ${toString cfg.insecure} \
${pkgs.prometheus-nginx-exporter}/bin/nginx-prometheus-exporter \
--nginx.scrape-uri '${cfg.scrapeUri}' \
--nginx.ssl-verify ${toString cfg.sslVerify} \
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
--web.telemetry-path ${cfg.telemetryPath} \
${concatStringsSep " \\\n " cfg.extraFlags}
'';
};
};
imports = [
(mkRenamedOptionModule [ "telemetryEndpoint" ] [ "telemetryPath" ])
(mkRemovedOptionModule [ "insecure" ] ''
This option was replaced by 'prometheus.exporters.nginx.sslVerify'.
'')
({ options.warnings = options.warnings; })
];
}