Skip to content

Commit

Permalink
contrib/internal/httptrace: use strings.Join to build multiple-ip tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellzy committed Jun 22, 2022
1 parent 6d1c0dc commit 165f5a5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions contrib/internal/httptrace/httptrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,10 @@ func genClientIPSpanTags(r *http.Request) []ddtrace.StartSpanOption {
}
return tags
}
sb := strings.Builder{}
for _, hdr := range matches {
tags = append(tags, tracer.Tag(ext.HTTPRequestHeaders+"."+hdr, ip))
sb.WriteString(hdr + ",")
}
hdrList := sb.String()
tags = append(tags, tracer.Tag(ext.MultipleIPHeaders, hdrList[:len(hdrList)-1]))
tags = append(tags, tracer.Tag(ext.MultipleIPHeaders, strings.Join(matches, ",")))
return tags
}

Expand Down

0 comments on commit 165f5a5

Please sign in to comment.