From 1c77b82c8e200846bab1354b7e457ac5725e6f0f Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Fri, 5 Apr 2019 21:20:46 -0700 Subject: [PATCH] Rename X-Request-ID to X-Correlation-ID As mentioned in https://gitlab.com/gitlab-org/gitlab-ce/issues/60111, Rails already uses X-Request-Id to track AJAX requests in the performance bar. The LabKit change breaks the performance bar as a result. --- correlation/inbound_http.go | 2 +- correlation/outbound_http.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/correlation/inbound_http.go b/correlation/inbound_http.go index 5090f1f8..f8538283 100644 --- a/correlation/inbound_http.go +++ b/correlation/inbound_http.go @@ -6,7 +6,7 @@ import ( // InjectCorrelationID is an HTTP middleware to generate an Correlation-ID for the incoming request, // or extract the existing Correlation-ID from the incoming request. By default, any upstream Correlation-ID, -// passed in via the `X-Request-ID` header will be ignored. To enable this behaviour, the `WithPropagation` +// passed in via the `X-Correlation-ID` header will be ignored. To enable this behaviour, the `WithPropagation` // option should be passed into the options. // Whether the Correlation-ID is generated or propagated, once inside this handler the request context // will have a Correlation-ID associated with it. diff --git a/correlation/outbound_http.go b/correlation/outbound_http.go index 0345a37b..17870d56 100644 --- a/correlation/outbound_http.go +++ b/correlation/outbound_http.go @@ -4,7 +4,7 @@ import ( "net/http" ) -const propagationHeader = "X-Request-ID" +const propagationHeader = "X-Correlation-ID" // injectRequest will pass the CorrelationId through to a downstream http request // for propagation @@ -29,7 +29,7 @@ func (c instrumentedRoundTripper) RoundTrip(req *http.Request) (res *http.Respon // transport. // // If will extract the current Correlation-ID from the request context and pass this via -// the X-Request-ID request header to downstream services. +// the X-Correlation-ID request header to downstream services. func NewInstrumentedRoundTripper(delegate http.RoundTripper, opts ...InstrumentedRoundTripperOption) http.RoundTripper { // Currently we don't use any of the options available applyInstrumentedRoundTripperOptions(opts) -- GitLab