From: Dan Fuhry Date: Mon, 19 Oct 2026 20:46:44 +0000 (-0400) Subject: [cmd/prometheus_http_discovery] change listener arg to address-and-port; update labels X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=7dc68ad10a7e3bcb265514ba58f7327ef1f16b25;p=runtime.git [cmd/prometheus_http_discovery] change listener arg to address-and-port; update labels --- diff --git a/cmd/prometheus_http_discovery/main.go b/cmd/prometheus_http_discovery/main.go index b286dfb..c180d77 100644 --- a/cmd/prometheus_http_discovery/main.go +++ b/cmd/prometheus_http_discovery/main.go @@ -29,7 +29,7 @@ func main() { serverCtx, cancel := context.WithCancel(context.Background()) defer cancel() - port := flag.Uint("port", 9102, "port to listen on") + listenAddr := flag.String("listen", "[::1]:9102", "address and port to listen on") flag.Parse() @@ -81,7 +81,7 @@ func main() { }, Labels: map[string]string{ "shard": ep.Shard, - "host": ep.Hostname, + "_host": ep.Hostname, }, }) } @@ -97,7 +97,7 @@ func main() { w.Write(out) }) server := &http.Server{ - Addr: fmt.Sprintf("[::1]:%d", *port), + Addr: *listenAddr, TLSConfig: tlsConfig, Handler: loggingMiddleware.HandlerFunc(), }