1{ config
2, lib
3, pkgs
4, options
5}:
6
7let
8 logPrefix = "services.prometheus.exporter.scaphandre";
9 cfg = config.services.prometheus.exporters.scaphandre;
10in {
11 port = 8080;
12 extraOpts = {
13 telemetryPath = lib.mkOption {
14 type = lib.types.str;
15 default = "/metrics";
16 description = lib.mdDoc ''
17 Path under which to expose metrics.
18 '';
19 };
20 };
21
22 serviceOpts = {
23 serviceConfig = {
24 ExecStart = ''
25 ${pkgs.scaphandre}/bin/scaphandre prometheus \
26 --address ${cfg.listenAddress} \
27 --port ${toString cfg.port} \
28 --suffix ${cfg.telemetryPath} \
29 ${lib.concatStringsSep " \\\n " cfg.extraFlags}
30 '';
31 };
32 };
33}