Skip to content

Commit

Permalink
contrib/internal/httptrace: set http.host tag on request Host not URL…
Browse files Browse the repository at this point in the history
… host
  • Loading branch information
ajgajg1134 committed Jun 6, 2022
1 parent 3528a0d commit 4f639ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/internal/httptrace/httptrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ func StartRequestSpan(r *http.Request, opts ...ddtrace.StartSpanOption) (tracer.
tracer.Tag(ext.HTTPUserAgent, r.UserAgent()),
tracer.Measured(),
}, opts...)
if r.URL.Host != "" {
if r.Host != "" {
opts = append([]ddtrace.StartSpanOption{
tracer.Tag("http.host", r.URL.Host),
tracer.Tag("http.host", r.Host),
}, opts...)
}
if spanctx, err := tracer.Extract(tracer.HTTPHeadersCarrier(r.Header)); err == nil {
Expand Down

0 comments on commit 4f639ea

Please sign in to comment.