1 { config, lib, pkgs, options, ... }:
4 cfg = config.services.prometheus.exporters.smokeping;
5 inherit (lib) mkOption types concatStringsSep;
6 goDuration = types.mkOptionType {
8 description = "Go duration (https://golang.org/pkg/time/#ParseDuration)";
9 check = x: types.str.check x && builtins.match "(-?[0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+" x != null;
10 inherit (types.str) merge;
16 telemetryPath = mkOption {
20 Path under which to expose metrics.
23 pingInterval = mkOption {
27 Interval between pings.
32 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";
34 List of buckets to use for the response duration histogram.
38 type = with types; listOf str;
40 List of endpoints to probe.
46 AmbientCapabilities = [ "CAP_NET_RAW" ];
47 CapabilityBoundingSet = [ "CAP_NET_RAW" ];
49 ${pkgs.prometheus-smokeping-prober}/bin/smokeping_prober \
50 --web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
51 --web.telemetry-path ${cfg.telemetryPath} \
52 --buckets ${cfg.buckets} \
53 --ping.interval ${cfg.pingInterval} \
55 ${concatStringsSep " \\\n " cfg.extraFlags} \
56 ${concatStringsSep " " cfg.hosts}