10 cfg = config.services.prometheus.exporters.smokeping;
11 inherit (lib) mkOption types concatStringsSep;
12 goDuration = types.mkOptionType {
14 description = "Go duration (https://golang.org/pkg/time/#ParseDuration)";
16 x: types.str.check x && builtins.match "(-?[0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+" x != null;
17 inherit (types.str) merge;
23 telemetryPath = mkOption {
27 Path under which to expose metrics.
30 pingInterval = mkOption {
34 Interval between pings.
39 default = "5e-05,0.0001,0.0002,0.0004,0.0008,0.0016,0.0032,0.0064,0.0128,0.0256,0.0512,0.1024,0.2048,0.4096,0.8192,1.6384,3.2768,6.5536,13.1072,26.2144";
41 List of buckets to use for the response duration histogram.
45 type = with types; listOf str;
47 List of endpoints to probe.
53 AmbientCapabilities = [ "CAP_NET_RAW" ];
54 CapabilityBoundingSet = [ "CAP_NET_RAW" ];
56 ${pkgs.prometheus-smokeping-prober}/bin/smokeping_prober \
57 --web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
58 --web.telemetry-path ${cfg.telemetryPath} \
59 --buckets ${cfg.buckets} \
60 --ping.interval ${cfg.pingInterval} \
62 ${concatStringsSep " \\\n " cfg.extraFlags} \
63 ${concatStringsSep " " cfg.hosts}