From 65af9da517c530a131637939d3bf446e5cd3bb7c Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 27 Apr 2019 20:04:00 +0700 Subject: [PATCH] fix port assignment --- tracing/opentracing/http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracing/opentracing/http.go b/tracing/opentracing/http.go index b598a3e2d..23c71debc 100644 --- a/tracing/opentracing/http.go +++ b/tracing/opentracing/http.go @@ -26,7 +26,7 @@ func ContextToHTTP(tracer opentracing.Tracer, logger log.Logger) kithttp.Request host, portString, err := net.SplitHostPort(req.URL.Host) if err == nil { ext.PeerHostname.Set(span, host) - if port, err := strconv.Atoi(portString); err != nil { + if port, err := strconv.Atoi(portString); err == nil { ext.PeerPort.Set(span, uint16(port)) } } else {