10 cfg = config.services.prometheus.exporters.varnish;
27 Do not exit server on Varnish scrape errors.
30 withGoMetrics = mkOption {
34 Export go runtime and http handler metrics.
41 Enable verbose logging.
48 Enable raw stdout logging without timestamps.
51 varnishStatPath = mkOption {
53 default = "varnishstat";
59 type = types.nullOr types.str;
60 default = config.services.varnish.stateDir;
61 defaultText = lib.literalExpression "config.services.varnish.stateDir";
66 healthPath = mkOption {
67 type = types.nullOr types.str;
70 Path under which to expose healthcheck. Disabled unless configured.
73 telemetryPath = mkOption {
77 Path under which to expose metrics.
82 path = [ config.services.varnish.package ];
84 RestartSec = mkDefault 1;
87 ${pkgs.prometheus-varnish-exporter}/bin/prometheus_varnish_exporter \
88 --web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
89 --web.telemetry-path ${cfg.telemetryPath} \
90 --varnishstat-path ${escapeShellArg cfg.varnishStatPath} \
91 ${concatStringsSep " \\\n " (
93 ++ optional (cfg.healthPath != null) "--web.health-path ${cfg.healthPath}"
94 ++ optional (cfg.instance != null) "-n ${escapeShellArg cfg.instance}"
95 ++ optional cfg.noExit "--no-exit"
96 ++ optional cfg.withGoMetrics "--with-go-metrics"
97 ++ optional cfg.verbose "--verbose"
98 ++ optional cfg.raw "--raw"