Send `correlation_id` of a parent request in asynchronous javascript requests
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=426378) </details> <!--IssueSummary end--> ## Description A new `correlation_id` gets generated in a few places (most frequently in Workhorse) after a new request is made to GitLab. Then we try to propagate this `correlation_id` throughout the application stack, for example, to Sidekiq or Gitaly, to understand the sequence of actions performed by GitLab. It seems, however, that the `correlation_id` is being lost when a asynchronous request to GitLab is being made by our JavaScript tooling; in such case a new `correlation_id` is being generated. ## Proposal Send the parent `correlation_id` in a header from a JavaScript request, append it to logs as an additional field, for example `correlation_ref` or some other field that would indicate that this is a related / parent / upstream `correlation_id` that comes from an untrusted source. ## Alternative Alternatively, we should check if OpenTelemetry has a solution for this problem already. /cc @stanhu @andrewn
issue