Merge pull request #275112 from r-ryantm/auto-update/prometheus-nginx-exporter

prometheus-nginx-exporter: 0.11.0 -> 1.0.0
This commit is contained in:
WilliButz 2023-12-20 20:27:28 +01:00 committed by GitHub
commit ac58b65cf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View File

@ -43,14 +43,14 @@ in
};
};
serviceOpts = mkMerge ([{
environment.CONST_LABELS = concatStringsSep "," cfg.constLabels;
serviceConfig = {
ExecStart = ''
${pkgs.prometheus-nginx-exporter}/bin/nginx-prometheus-exporter \
--nginx.scrape-uri='${cfg.scrapeUri}' \
--nginx.ssl-verify=${boolToString cfg.sslVerify} \
--${lib.optionalString (!cfg.sslVerify) "no-"}nginx.ssl-verify \
--web.listen-address=${cfg.listenAddress}:${toString cfg.port} \
--web.telemetry-path=${cfg.telemetryPath} \
--prometheus.const-labels=${concatStringsSep "," cfg.constLabels} \
${concatStringsSep " \\\n " cfg.extraFlags}
'';
};

View File

@ -806,6 +806,7 @@ let
nginx = {
exporterConfig = {
enable = true;
constLabels = [ "foo=bar" ];
};
metricProvider = {
services.nginx = {
@ -818,7 +819,7 @@ let
wait_for_unit("nginx.service")
wait_for_unit("prometheus-nginx-exporter.service")
wait_for_open_port(9113)
succeed("curl -sSf http://localhost:9113/metrics | grep 'nginx_up 1'")
succeed("curl -sSf http://localhost:9113/metrics | grep 'nginx_up{foo=\"bar\"} 1'")
'';
};

View File

@ -2,16 +2,16 @@
buildGoModule rec {
pname = "nginx_exporter";
version = "0.11.0";
version = "1.0.0";
src = fetchFromGitHub {
owner = "nginxinc";
repo = "nginx-prometheus-exporter";
rev = "v${version}";
sha256 = "sha256-glKjScJoJnFEm7Z9LAVF51haeyHB3wQ946U8RzJXs3k=";
sha256 = "sha256-fnYZmJxXY1RaPJX8KiKxFmMauP5Jh5H72FWjIwgoIio=";
};
vendorHash = "sha256-YyMySHnrjBHm3hRNJDwWBs86Ih4S5DONYuwlQ3FBjkA=";
vendorHash = "sha256-VkatDZerLKnfbNFtnjklkE3TLY57uO1WUGa/p5tAXSQ=";
ldflags = [ "-s" "-w" "-X main.version=${version}" ];