From 1c1f092a14d63a12cdc2374e4f92a4599c902bd0 Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Sat, 11 Oct 2025 21:54:16 +0800 Subject: [PATCH] fix metrics wrapper --- handler/tunnel/handler.go | 2 +- metrics/wrapper/conn.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/handler/tunnel/handler.go b/handler/tunnel/handler.go index 589654b5..64783baa 100644 --- a/handler/tunnel/handler.go +++ b/handler/tunnel/handler.go @@ -184,7 +184,7 @@ func (h *tunnelHandler) createEntrypointService(addr string, ingress ingress.Ing "kind": "service", }) epListener := newTCPListener(ln, - listener.AddrOption(h.md.entryPoint), + listener.AddrOption(addr), listener.ServiceOption(serviceName), listener.ProxyProtocolOption(h.md.entryPointProxyProtocol), listener.LoggerOption(log.WithFields(map[string]any{ diff --git a/metrics/wrapper/conn.go b/metrics/wrapper/conn.go index 1c000902..fe4ec4a2 100644 --- a/metrics/wrapper/conn.go +++ b/metrics/wrapper/conn.go @@ -27,7 +27,7 @@ type serverConn struct { } func WrapConn(service string, c net.Conn) net.Conn { - if !xmetrics.IsEnabled() || c == nil { + if c == nil { return c } @@ -102,7 +102,7 @@ type packetConn struct { } func WrapPacketConn(service string, pc net.PacketConn) net.PacketConn { - if !xmetrics.IsEnabled() || pc == nil { + if pc == nil { return pc } return &packetConn{