From 30ecb9f4adf9f1bd440a9d4cbb6345069750cb7b Mon Sep 17 00:00:00 2001 From: dblinkhorn Date: Thu, 6 Aug 2026 11:00:06 -0700 Subject: [PATCH] feat: enable logging of github request ID --- githubapp/middleware_logging.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/githubapp/middleware_logging.go b/githubapp/middleware_logging.go index 0ad5da88..79a9c163 100644 --- a/githubapp/middleware_logging.go +++ b/githubapp/middleware_logging.go @@ -32,6 +32,7 @@ const ( httpHeaderRateUsed = "X-Ratelimit-Used" httpHeaderRateReset = "X-Ratelimit-Reset" httpHeaderRateResource = "X-Ratelimit-Resource" + httpHeaderRequestID = "X-GitHub-Request-Id" ) // ClientLogging creates client middleware that logs request and response @@ -73,6 +74,9 @@ func ClientLogging(lvl zerolog.Level, opts ...ClientLoggingOption) ClientMiddlew cached := res.Header.Get(httpcache.XFromCache) != "" evt.Bool("cached", cached). Int("status", res.StatusCode) + if requestID := res.Header.Get(httpHeaderRequestID); requestID != "" { + evt.Str("github_request_id", requestID) + } size := res.ContentLength if requestMatches(r, options.ResponseBodyPatterns) {