Skip to content

Commit

Permalink
add a span tag for content type if the header is set (#614)
Browse files Browse the repository at this point in the history
Signed-off-by: Callum Styan <[email protected]>
  • Loading branch information
cstyan authored Oct 24, 2024
1 parent 9018c0e commit a4a4dca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions middleware/http_tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ func (t Tracer) Wrap(next http.Handler) http.Handler {
sp.SetTag("http.user_agent", userAgent)
}

// add the content type, useful when query requests are sent as POST
if ct := r.Header.Get("Content-Type"); ct != "" {
sp.SetTag("http.content_type", ct)
}

// add a tag with the client's sourceIPs to the span, if a
// SourceIPExtractor is given.
if t.SourceIPs != nil {
Expand Down

0 comments on commit a4a4dca

Please sign in to comment.