9 logPrefix = "services.prometheus.exporter.php-fpm";
10 cfg = config.services.prometheus.exporters.php-fpm;
14 package = lib.mkPackageOption pkgs "prometheus-php-fpm-exporter" {};
16 telemetryPath = lib.mkOption {
20 Path under which to expose metrics.
24 environmentFile = lib.mkOption {
25 type = lib.types.nullOr lib.types.path;
27 example = "/root/prometheus-php-fpm-exporter.env";
29 Environment file as defined in {manpage}`systemd.exec(5)`.
31 Secrets may be passed to the service without adding them to the
32 world-readable Nix store, by specifying placeholder variables as
33 the option value in Nix and setting these variables accordingly in the
36 Environment variables from this file will be interpolated into the
37 config file using envsubst with this syntax:
38 `$ENVIRONMENT ''${VARIABLE}`
40 For variables to use see [options and defaults](https://github.com/hipages/php-fpm_exporter#options-and-defaults).
42 The main use is to set the PHP_FPM_SCRAPE_URI that indicate how to connect to PHP-FPM process.
45 # Content of the environment file
46 PHP_FPM_SCRAPE_URI="unix:///tmp/php.sock;/status"
49 Note that this file needs to be available on the host on which
50 this exporter is running.
57 EnvironmentFile = lib.mkIf (cfg.environmentFile != null) [ cfg.environmentFile ];
59 ${lib.getExe cfg.package} server \
60 --web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
61 --web.telemetry-path ${cfg.telemetryPath} \
62 ${lib.concatStringsSep " \\\n " cfg.extraFlags}