Loading
workhorse: Add AdoptCfRayHeader configuration option
What does this MR do and why?
This change introduces a new configuration flag adoptCfRayHeader that allows
GitLab Workhorse to adopt the Cloudflare Cf-Ray header as the correlation ID
when both propagateCorrelationID and adoptCfRayHeader are enabled.
When enabled, the correlation middleware will:
- Use the Cf-Ray header value as the correlation ID if present
- Fall back to X-Request-ID if Cf-Ray is not present
- Generate a new ID if neither header is available
This is useful for deployments behind Cloudflare where tracking requests using the Cf-Ray ID provides better end-to-end visibility.
Changes:
- Add adoptCfRayHeader boolean flag to configuration
- Update LabKit to v1.29.0 which includes WithAdoptCfRayHeader support
- Pass correlation.WithAdoptCfRayHeader() option when flag is enabled
- Add comprehensive test coverage for the new feature
References
- Second installation of gitlab-com/gl-infra/production-engineering#27565 (comment 2741955770)
- LabKit support was added here: labkit!223 (merged)
- This MR brings that change into workhorse
Screenshots or screen recordings
| Before | After |
|---|---|
n/a
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.