From d439f89536279af125b9f90cdd4417b533aec3ee Mon Sep 17 00:00:00 2001 From: Sky Date: Wed, 3 Apr 2024 06:52:36 +0000 Subject: Allow to set listen address for metrics service via cl flags --- proxy/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/main.go b/proxy/main.go index a385aee..5df1893 100644 --- a/proxy/main.go +++ b/proxy/main.go @@ -35,6 +35,7 @@ func main() { "the time interval to output summary, 0s disables summaries. Valid time units are \"s\", \"m\", \"h\". ") disableStatsLogger := flag.Bool("disable-stats-logger", false, "disable the exposing mechanism for stats using logs") enableMetrics := flag.Bool("metrics", false, "enable the exposing mechanism for stats using metrics") + metricsAddress := flag.String("metrics-address", "localhost", "set listen address for metrics service") metricsPort := flag.Int("metrics-port", 9999, "set port for the metrics service") verboseLogging := flag.Bool("verbose", false, "increase log verbosity") ephemeralPortsRangeFlag := flag.String("ephemeral-ports-range", "", "ICE UDP ephemeral ports range (format:\":\")") @@ -133,7 +134,7 @@ func main() { if *enableMetrics { metrics := sf.NewMetrics() - err := metrics.Start(net.JoinHostPort("localhost", strconv.Itoa(*metricsPort))) + err := metrics.Start(net.JoinHostPort(*metricsAddress, strconv.Itoa(*metricsPort))) if err != nil { log.Fatalf("could not enable metrics: %v", err) } -- cgit v1.2.3-54-g00ecf