From 9cee384a4e45be3d5cac1804ca17a89d90ea58fc Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Thu, 21 Mar 2024 11:49:32 -0700 Subject: [PATCH] Update metrics listener --- pkg/metrics/metrics.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go index e7b2771a..d8b37887 100644 --- a/pkg/metrics/metrics.go +++ b/pkg/metrics/metrics.go @@ -6,6 +6,7 @@ import ( "net" "net/http" + "github.com/pires/go-proxyproto" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/xmtp/xmtp-node-go/pkg/tracing" @@ -24,9 +25,9 @@ func NewMetricsServer(ctx context.Context, address string, port int, log *zap.Lo log: log.Named("metrics"), } - var err error addr := fmt.Sprintf("%s:%d", address, port) - s.http, err = net.Listen("tcp", addr) + httpListener, err := net.Listen("tcp", addr) + s.http = &proxyproto.Listener{Listener: httpListener} if err != nil { return nil, err }