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