Skip to content

Forward correlationId to Elasticsearch as X-Opaque-Id

Forwarding our correlation ID as the X-Opaque-Id will allow us to track any long running tasks in the cluster back the request in GitLab. This could help us track down problems like gitlab-com/gl-infra/production#2318 (closed) where we believe a single problematic project may be making the cluster unstable.

We've already merged the same thing for our ruby client in gitlab!35403 (merged)

This MR also includes a refactoring to move the generateCorrelationID function to the top level. Since the correlationID is needed by both the gitaly client and elastic client it is best to generate above those and pass it through. This helps as well if we end up generating a random correlation ID we'll ensure that this random correlation ID is at least the same for both clients.

We also remove an error branch here and just return empty string instead of failing like the previous code since we don't really think this will happen but even if it did we shouldn't crash the process as the correlation ID is not necessary for the program to keep operating.

See also gitlab#224630 (closed)

Edited by Dylan Griffith

Merge request reports

Loading