Loading nixos/modules/services/monitoring/prometheus/exporters/nginx.nix +2 −2 Original line number Diff line number Diff line Loading @@ -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} ''; }; Loading nixos/tests/prometheus-exporters.nix +2 −1 Original line number Diff line number Diff line Loading @@ -806,6 +806,7 @@ let nginx = { exporterConfig = { enable = true; constLabels = [ "foo=bar" ]; }; metricProvider = { services.nginx = { Loading @@ -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'") ''; }; Loading Loading
nixos/modules/services/monitoring/prometheus/exporters/nginx.nix +2 −2 Original line number Diff line number Diff line Loading @@ -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} ''; }; Loading
nixos/tests/prometheus-exporters.nix +2 −1 Original line number Diff line number Diff line Loading @@ -806,6 +806,7 @@ let nginx = { exporterConfig = { enable = true; constLabels = [ "foo=bar" ]; }; metricProvider = { services.nginx = { Loading @@ -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'") ''; }; Loading