1 { config, lib, pkgs, options, ... }:
4 cfg = config.services.prometheus.exporters.flow;
16 type = types.listOf types.str;
17 example = literalExpression ''[ "kafka.example.org:19092" ]'';
18 description = "List of Kafka brokers to connect to.";
22 type = types.ints.positive;
24 description = "The ASN being monitored.";
27 partitions = mkOption {
28 type = types.listOf types.int;
31 The number of the partitions to consume, none means all.
37 example = "pmacct.acct";
38 description = "The Kafka topic to consume from.";
46 ${pkgs.prometheus-flow-exporter}/bin/flow-exporter \
47 -asn ${toString cfg.asn} \
49 -brokers ${concatStringsSep "," cfg.brokers} \
50 ${optionalString (cfg.partitions != []) "-partitions ${concatStringsSep "," cfg.partitions}"} \
51 -addr ${cfg.listenAddress}:${toString cfg.port} ${concatStringsSep " " cfg.extraFlags}