Skip to content

Commit

Permalink
Add amazon request ID header values to the trace for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
bjohnso5 committed Nov 12, 2024
1 parent f9dadbc commit c11d3fa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions httpclient/httpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,12 @@ func addRespToSpan(span o11y.Span, res *http.Response) {
if ce := res.Header.Get("Content-Encoding"); ce != "" {
span.AddRawField("http.response_content_encoding", ce)
}
if rID := res.Header.Get("x-amz-request-id"); rID != "" {
span.AddRawField("http.amz_request_id", rID)
}
if rID2 := res.Header.Get("x-amz-id-2"); rID2 != "" {
span.AddRawField("http.amz_id_2", rID2)
}
span.AddRawField("http.status_code", res.StatusCode)
}

Expand Down

0 comments on commit c11d3fa

Please sign in to comment.