Log and pass correlation-id between Unicorn, Sidekiq and Gitaly
What does this MR do?
The Correlation ID is taken or generated from received X-Request-ID. Then it is being passed to all executed services (sidekiq workers or gitaly calls).
The Correlation ID is logged in all structured logs as correlation_id
.
Pass Correlation ID to Sentry.
What was tested?
-
Correlation ID is generated by Workhorse and passed in X-Request-ID
, -
Correlation ID is put into production/development_json
for all Controller calls ascorrelation_id
, -
Correlation ID is put into api_json
for all API calls ascorrelation_id
, -
Correlation ID is put into sidekiq logs
for executed Sidekiq workers ascorrelation_id
, -
Correlation ID is passed to another Sidekiq job if executed by Sidekiq, -
Correlation ID is passed in HTTP request to Gitaly as correlation_id
, -
A new Correlation ID is generated for all cron-executed sidekiq jobs, -
A trackable exception ( Gitlab::Sentry::trackable_exception
) send to sentry includes Correlation ID as a tag, -
An exception send to sentry includes Correlation ID when originating from Unicorn (it works, but this is hidden as X-Request-ID
header), -
An exception send to sentry includes Correlation ID when originating from Sidekiq (it works, but this is hidden in sidekiq payload),
What are the relevant issue numbers?
Relates to gitlab-com/support/support-team-meta#1259 (closed)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process.
Edited by Kamil Trzciński (Back 2025-01-01)