fix(correlation): cf-ray header precedance

What

X-Request-ID takes precedence over cf-ray header for correlation.

Why

We can have two services communicating with each other that are behind Cloudflare for example, HTTP Router and Topology Service. When the HTTP Router sends a request to Topology Service cf-ray gets regenerated by Cloudflare, so we can never correlate anything between the two services.

User

Cloudflare Edge (DME/Moscow) → Ray ID: 9c40f4f908af1229

HTTP Router (CF Worker)

Cloudflare Zero Trust / Proxy () → NEW Ray ID: Random ID

Topology Service (GCP)

Topology Service (GCP) logs `Random ID` instead of 9c40f4f908af1229

If X-Request-ID takes precedence we can still use cf-ray as the correlation ID for services that are the public entry point and don't specify X-Request-ID.

reference: https://gitlab.com/gitlab-com/gl-infra/production-engineering/-/work_items/28225

Merge request reports

Loading