@@ -157,7 +157,14 @@ func (c *HTTPConv) ClientRequest(req *http.Request) []attribute.KeyValue {
157
157
// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id",
158
158
// "http.client_ip".
159
159
func (c * HTTPConv ) ServerRequest (server string , req * http.Request ) []attribute.KeyValue {
160
- n := 5 // Method, scheme, target, proto, and host name.
160
+ // TODO: This currently does not add the specification required
161
+ // `http.target` attribute. It has too high of a cardinality to safely be
162
+ // added. An alternate should be added, or this comment removed, when it is
163
+ // addressed by the specification. If it is ultimately decided to continue
164
+ // not including the attribute, the HTTPTargetKey field of the HTTPConv
165
+ // should be removed as well.
166
+
167
+ n := 4 // Method, scheme, proto, and host name.
161
168
var host string
162
169
var p int
163
170
if server == "" {
@@ -199,14 +206,6 @@ func (c *HTTPConv) ServerRequest(server string, req *http.Request) []attribute.K
199
206
attrs = append (attrs , c .proto (req .Proto ))
200
207
attrs = append (attrs , c .NetConv .HostName (host ))
201
208
202
- if req .URL != nil {
203
- attrs = append (attrs , c .HTTPTargetKey .String (req .URL .RequestURI ()))
204
- } else {
205
- // This should never occur if the request was generated by the net/http
206
- // package. Fail gracefully, if it does though.
207
- attrs = append (attrs , c .HTTPTargetKey .String (req .RequestURI ))
208
- }
209
-
210
209
if hostPort > 0 {
211
210
attrs = append (attrs , c .NetConv .HostPort (hostPort ))
212
211
}
0 commit comments