Skip to content

Commit

Permalink
Set content-length field, if it is present in the abstract header.
Browse files Browse the repository at this point in the history
  • Loading branch information
buechele authored Jul 16, 2024
1 parent 5913964 commit 81f8de3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions nethttp_request_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ func (a *NetHttpRequestAdapter) getRequestFromRequestInformation(ctx context.Con
}
if request.Header.Get("Content-Length") != "" {
contentLenVal, _ := strconv.Atoi(request.Header.Get("Content-Length"))
request.ContentLength = int64(contentLenVal)
spanForAttributes.SetAttributes(
attribute.Int("http.request_content_length", contentLenVal),
)
Expand Down

0 comments on commit 81f8de3

Please sign in to comment.