diff --git a/README.md b/README.md index 8eb4758..63eb7ea 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ The exporter can be started with: ./flow-exporter --brokers=kafka.fqdn.com:9092 --topic=pmacct.acct --asn=15169 ``` +- `--addr`: Listening address (default = :9590) - `--brokers`: A comma separated list of Kafka brokers (with their corresponding ports) to consume flows from - `--topic`: The Kafka topic to consume flows from - `--asn`: The autonomous system number that the flows are being monitored from diff --git a/cmd/flow-exporter/main.go b/cmd/flow-exporter/main.go index 3c7e3ba..0e2f3ab 100644 --- a/cmd/flow-exporter/main.go +++ b/cmd/flow-exporter/main.go @@ -17,6 +17,7 @@ var ( topic = flag.String("topic", "", "The Kafka topic to consume from") partitions = flag.String("partitions", "all", "The partitions to consume, can be 'all' or comma-separated numbers") asn = flag.Int("asn", 0, "The ASN being monitored") + addr = flag.String("addr", ":9590", "Listening Address") ) func main() { @@ -39,9 +40,9 @@ func main() { } go func() { - log.Info("Starting Prometheus web server, available at: http://localhost:9590/metrics") + log.Infof("Starting Prometheus web server, available at: http://%s/metrics", *addr) http.Handle("/metrics", promhttp.Handler()) - http.ListenAndServe(":9590", nil) + http.ListenAndServe(*addr, nil) }() consumer.Consume(*brokers, *topic, *partitions, *asn, asns)