From c11d3faac4073de6dba22e75d8b3038b80e61a2b Mon Sep 17 00:00:00 2001 From: Bryan Johnson Date: Tue, 12 Nov 2024 07:56:34 -0500 Subject: [PATCH] Add amazon request ID header values to the trace for debugging --- httpclient/httpclient.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/httpclient/httpclient.go b/httpclient/httpclient.go index 88a0dea95..e77e20749 100644 --- a/httpclient/httpclient.go +++ b/httpclient/httpclient.go @@ -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) }