From 3541453403a126509b76d8e429a12e3d554a7a58 Mon Sep 17 00:00:00 2001 From: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com> Date: Thu, 7 Sep 2023 10:15:25 -0500 Subject: [PATCH] Address PR comments --- .../otelrestful/internal/semconvutil/httpconv.go | 10 ++++------ .../gin/otelgin/internal/semconvutil/httpconv.go | 10 ++++------ .../mux/otelmux/internal/semconvutil/httpconv.go | 10 ++++------ .../echo/otelecho/internal/semconvutil/httpconv.go | 10 ++++------ .../otelmacaron/internal/semconvutil/httpconv.go | 10 ++++------ .../otelhttptrace/internal/semconvutil/httpconv.go | 10 ++++------ .../net/http/otelhttp/internal/semconvutil/httpconv.go | 10 ++++------ internal/shared/semconvutil/httpconv.go.tmpl | 10 ++++------ 8 files changed, 32 insertions(+), 48 deletions(-) diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/internal/semconvutil/httpconv.go b/instrumentation/github.com/emicklei/go-restful/otelrestful/internal/semconvutil/httpconv.go index 9bb1c1da477..011d80e3247 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/internal/semconvutil/httpconv.go +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/internal/semconvutil/httpconv.go @@ -83,7 +83,7 @@ func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue { return hc.ServerRequest(server, req) } -// HTTPServerRequestMetrics returns trace attributes for an HTTP request received by a +// HTTPServerRequestMetrics returns metric attributes for an HTTP request received by a // server. // // The server must be the primary server name if it is known. For example this @@ -373,7 +373,7 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K return attrs } -// ServerRequestMetrics returns Metric attributes for an HTTP request received +// ServerRequestMetrics returns metric attributes for an HTTP request received // by a server. // // The server must be the primary server name if it is known. For example this @@ -391,10 +391,8 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K // The req Host will be used to determine the server instead. // // The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "http.target", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port", -// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", -// "http.client_ip". +// "http.flavor", "net.host.name". The following attributes are +// returned if they related values are defined in req: "net.host.port". func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue { // TODO: This currently does not add the specification required // `http.target` attribute. It has too high of a cardinality to safely be diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/internal/semconvutil/httpconv.go b/instrumentation/github.com/gin-gonic/gin/otelgin/internal/semconvutil/httpconv.go index b42d27e42f9..775c0a3dcf6 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/internal/semconvutil/httpconv.go +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/internal/semconvutil/httpconv.go @@ -83,7 +83,7 @@ func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue { return hc.ServerRequest(server, req) } -// HTTPServerRequestMetrics returns trace attributes for an HTTP request received by a +// HTTPServerRequestMetrics returns metric attributes for an HTTP request received by a // server. // // The server must be the primary server name if it is known. For example this @@ -373,7 +373,7 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K return attrs } -// ServerRequestMetrics returns Metric attributes for an HTTP request received +// ServerRequestMetrics returns metric attributes for an HTTP request received // by a server. // // The server must be the primary server name if it is known. For example this @@ -391,10 +391,8 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K // The req Host will be used to determine the server instead. // // The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "http.target", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port", -// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", -// "http.client_ip". +// "http.flavor", "net.host.name". The following attributes are +// returned if they related values are defined in req: "net.host.port". func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue { // TODO: This currently does not add the specification required // `http.target` attribute. It has too high of a cardinality to safely be diff --git a/instrumentation/github.com/gorilla/mux/otelmux/internal/semconvutil/httpconv.go b/instrumentation/github.com/gorilla/mux/otelmux/internal/semconvutil/httpconv.go index 8c652e044fe..3e658ea4693 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/internal/semconvutil/httpconv.go +++ b/instrumentation/github.com/gorilla/mux/otelmux/internal/semconvutil/httpconv.go @@ -83,7 +83,7 @@ func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue { return hc.ServerRequest(server, req) } -// HTTPServerRequestMetrics returns trace attributes for an HTTP request received by a +// HTTPServerRequestMetrics returns metric attributes for an HTTP request received by a // server. // // The server must be the primary server name if it is known. For example this @@ -373,7 +373,7 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K return attrs } -// ServerRequestMetrics returns Metric attributes for an HTTP request received +// ServerRequestMetrics returns metric attributes for an HTTP request received // by a server. // // The server must be the primary server name if it is known. For example this @@ -391,10 +391,8 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K // The req Host will be used to determine the server instead. // // The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "http.target", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port", -// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", -// "http.client_ip". +// "http.flavor", "net.host.name". The following attributes are +// returned if they related values are defined in req: "net.host.port". func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue { // TODO: This currently does not add the specification required // `http.target` attribute. It has too high of a cardinality to safely be diff --git a/instrumentation/github.com/labstack/echo/otelecho/internal/semconvutil/httpconv.go b/instrumentation/github.com/labstack/echo/otelecho/internal/semconvutil/httpconv.go index 355731fdf3d..1f73ae65f8e 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/internal/semconvutil/httpconv.go +++ b/instrumentation/github.com/labstack/echo/otelecho/internal/semconvutil/httpconv.go @@ -83,7 +83,7 @@ func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue { return hc.ServerRequest(server, req) } -// HTTPServerRequestMetrics returns trace attributes for an HTTP request received by a +// HTTPServerRequestMetrics returns metric attributes for an HTTP request received by a // server. // // The server must be the primary server name if it is known. For example this @@ -373,7 +373,7 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K return attrs } -// ServerRequestMetrics returns Metric attributes for an HTTP request received +// ServerRequestMetrics returns metric attributes for an HTTP request received // by a server. // // The server must be the primary server name if it is known. For example this @@ -391,10 +391,8 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K // The req Host will be used to determine the server instead. // // The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "http.target", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port", -// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", -// "http.client_ip". +// "http.flavor", "net.host.name". The following attributes are +// returned if they related values are defined in req: "net.host.port". func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue { // TODO: This currently does not add the specification required // `http.target` attribute. It has too high of a cardinality to safely be diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/internal/semconvutil/httpconv.go b/instrumentation/gopkg.in/macaron.v1/otelmacaron/internal/semconvutil/httpconv.go index 6d96be505bf..8a638d6db63 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/internal/semconvutil/httpconv.go +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/internal/semconvutil/httpconv.go @@ -83,7 +83,7 @@ func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue { return hc.ServerRequest(server, req) } -// HTTPServerRequestMetrics returns trace attributes for an HTTP request received by a +// HTTPServerRequestMetrics returns metric attributes for an HTTP request received by a // server. // // The server must be the primary server name if it is known. For example this @@ -373,7 +373,7 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K return attrs } -// ServerRequestMetrics returns Metric attributes for an HTTP request received +// ServerRequestMetrics returns metric attributes for an HTTP request received // by a server. // // The server must be the primary server name if it is known. For example this @@ -391,10 +391,8 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K // The req Host will be used to determine the server instead. // // The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "http.target", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port", -// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", -// "http.client_ip". +// "http.flavor", "net.host.name". The following attributes are +// returned if they related values are defined in req: "net.host.port". func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue { // TODO: This currently does not add the specification required // `http.target` attribute. It has too high of a cardinality to safely be diff --git a/instrumentation/net/http/httptrace/otelhttptrace/internal/semconvutil/httpconv.go b/instrumentation/net/http/httptrace/otelhttptrace/internal/semconvutil/httpconv.go index ab9f7c02966..f85894ac474 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/internal/semconvutil/httpconv.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/internal/semconvutil/httpconv.go @@ -83,7 +83,7 @@ func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue { return hc.ServerRequest(server, req) } -// HTTPServerRequestMetrics returns trace attributes for an HTTP request received by a +// HTTPServerRequestMetrics returns metric attributes for an HTTP request received by a // server. // // The server must be the primary server name if it is known. For example this @@ -373,7 +373,7 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K return attrs } -// ServerRequestMetrics returns Metric attributes for an HTTP request received +// ServerRequestMetrics returns metric attributes for an HTTP request received // by a server. // // The server must be the primary server name if it is known. For example this @@ -391,10 +391,8 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K // The req Host will be used to determine the server instead. // // The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "http.target", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port", -// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", -// "http.client_ip". +// "http.flavor", "net.host.name". The following attributes are +// returned if they related values are defined in req: "net.host.port". func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue { // TODO: This currently does not add the specification required // `http.target` attribute. It has too high of a cardinality to safely be diff --git a/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go b/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go index 30919dcba78..d3dede9ebbd 100644 --- a/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go +++ b/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go @@ -83,7 +83,7 @@ func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue { return hc.ServerRequest(server, req) } -// HTTPServerRequestMetrics returns trace attributes for an HTTP request received by a +// HTTPServerRequestMetrics returns metric attributes for an HTTP request received by a // server. // // The server must be the primary server name if it is known. For example this @@ -373,7 +373,7 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K return attrs } -// ServerRequestMetrics returns Metric attributes for an HTTP request received +// ServerRequestMetrics returns metric attributes for an HTTP request received // by a server. // // The server must be the primary server name if it is known. For example this @@ -391,10 +391,8 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K // The req Host will be used to determine the server instead. // // The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "http.target", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port", -// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", -// "http.client_ip". +// "http.flavor", "net.host.name". The following attributes are +// returned if they related values are defined in req: "net.host.port". func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue { // TODO: This currently does not add the specification required // `http.target` attribute. It has too high of a cardinality to safely be diff --git a/internal/shared/semconvutil/httpconv.go.tmpl b/internal/shared/semconvutil/httpconv.go.tmpl index ef8d112213d..7149b9f89c8 100644 --- a/internal/shared/semconvutil/httpconv.go.tmpl +++ b/internal/shared/semconvutil/httpconv.go.tmpl @@ -83,7 +83,7 @@ func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue { return hc.ServerRequest(server, req) } -// HTTPServerRequestMetrics returns trace attributes for an HTTP request received by a +// HTTPServerRequestMetrics returns metric attributes for an HTTP request received by a // server. // // The server must be the primary server name if it is known. For example this @@ -373,7 +373,7 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K return attrs } -// ServerRequestMetrics returns Metric attributes for an HTTP request received +// ServerRequestMetrics returns metric attributes for an HTTP request received // by a server. // // The server must be the primary server name if it is known. For example this @@ -391,10 +391,8 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K // The req Host will be used to determine the server instead. // // The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "http.target", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port", -// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", -// "http.client_ip". +// "http.flavor", "net.host.name". The following attributes are +// returned if they related values are defined in req: "net.host.port". func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue { // TODO: This currently does not add the specification required // `http.target` attribute. It has too high of a cardinality to safely be