40
40
cfg = newConfig ()
41
41
)
42
42
43
+ // multipleIPHeaders sets the multiple ip header tag used internally to tell the backend an error occurred when
44
+ // retrieving an HTTP request client IP.
45
+ const multipleIPHeaders = "_dd.multiple-ip-headers"
46
+
43
47
// StartRequestSpan starts an HTTP request span with the standard list of HTTP request span tags (http.method, http.url,
44
48
// http.useragent). Any further span start option can be added with opts.
45
49
func StartRequestSpan (r * http.Request , opts ... ddtrace.StartSpanOption ) (tracer.Span , context.Context ) {
@@ -91,7 +95,7 @@ func ippref(s string) *netaddr.IPPrefix {
91
95
}
92
96
93
97
// genClientIPSpanTags generates the client IP related tags that need to be added to the span.
94
- // See https://datadoghq.atlassian.net/wiki/spaces/APS/pages/2118779066/Client+IP+addresses+resolution
98
+ // See https://docs. datadoghq.com/tracing/configure_data_security#configuring-a-client-ip-header for more information.
95
99
func genClientIPSpanTags (r * http.Request ) []ddtrace.StartSpanOption {
96
100
ipHeaders := defaultIPHeaders
97
101
if len (cfg .clientIPHeader ) > 0 {
@@ -122,7 +126,7 @@ func genClientIPSpanTags(r *http.Request) []ddtrace.StartSpanOption {
122
126
for i := range ips {
123
127
opts = append (opts , tracer .Tag (ext .HTTPRequestHeaders + "." + headers [i ], ips [i ]))
124
128
}
125
- opts = append (opts , tracer .Tag (ext . MultipleIPHeaders , strings .Join (headers , "," )))
129
+ opts = append (opts , tracer .Tag (multipleIPHeaders , strings .Join (headers , "," )))
126
130
}
127
131
return opts
128
132
}
@@ -157,7 +161,7 @@ func isGlobal(ip netaddr.IP) bool {
157
161
158
162
// urlFromRequest returns the full URL from the HTTP request. If query params are collected, they are obfuscated granted
159
163
// obfuscation is not disabled by the user (through DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP)
160
- // For more information see https://datadoghq.atlassian.net/wiki/spaces/APM/pages/2357395856/Span+attributes#http. url
164
+ // See https://docs. datadoghq.com/tracing/configure_data_security#redacting-the-query-in-the- url for more information.
161
165
func urlFromRequest (r * http.Request ) string {
162
166
// Quoting net/http comments about net.Request.URL on server requests:
163
167
// "For most requests, fields other than Path and RawQuery will be
@@ -175,7 +179,6 @@ func urlFromRequest(r *http.Request) string {
175
179
url = path
176
180
}
177
181
// Collect the query string if we are allowed to report it and obfuscate it if possible/allowed
178
- // https://datadoghq.atlassian.net/wiki/spaces/APS/pages/2490990623/QueryString+-+Sensitive+Data+Obfuscation
179
182
if cfg .queryString && r .URL .RawQuery != "" {
180
183
query := r .URL .RawQuery
181
184
if cfg .queryStringRegexp != nil {
0 commit comments