From a62fc8b1a0cc0803dd1953aa62594d6cfe3a2fd7 Mon Sep 17 00:00:00 2001 From: bitliu Date: Thu, 26 Oct 2023 10:27:50 +0800 Subject: [PATCH] update Signed-off-by: bitliu --- internal/metrics/register.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/metrics/register.go b/internal/metrics/register.go index 627a49355521..8ced984c35f9 100644 --- a/internal/metrics/register.go +++ b/internal/metrics/register.go @@ -144,7 +144,7 @@ func registerOTELPromExporter(otelOpts *[]metric.Option, opts registerOptions) e func registerOTELHTTPexporter(otelOpts *[]metric.Option, opts registerOptions) error { for _, sink := range opts.pushOptions.sinks { if sink.protocol == v1alpha1.HTTPProtocol { - address := fmt.Sprintf("%s:%d", sink.host, sink.port) + address := net.JoinHostPort(sink.host, fmt.Sprint(sink.port)) httpexporter, err := otlpmetrichttp.New( context.Background(), otlpmetrichttp.WithEndpoint(address),