diff --git a/ee/lib/gitlab/checks/secret_push_protection/secrets_check.rb b/ee/lib/gitlab/checks/secret_push_protection/secrets_check.rb index bc0c7a4da63a3d5a8fbc290a45c0a9dbe557fbb3..b702c777c712f0375e5f2e68b0f2da9d847d3af5 100644 --- a/ee/lib/gitlab/checks/secret_push_protection/secrets_check.rb +++ b/ee/lib/gitlab/checks/secret_push_protection/secrets_check.rb @@ -68,6 +68,8 @@ def run_validation! thread = nil + current_context = Labkit::Context.current.to_h + logger.log_timed(LOG_MESSAGES[:secrets_check]) do payloads = payload_processor.standardize_payloads @@ -79,12 +81,14 @@ def run_validation! Thread.current.abort_on_exception = false Thread.current.report_on_exception = false - extra_headers = { - 'x-correlation-id': correlation_id - } - sds_client.send_request_to_sds(payloads, - exclusions: exclusions_manager.active_exclusions, - extra_headers: extra_headers) + Labkit::Context.with_context(current_context) do + extra_headers = { + 'x-correlation-id': correlation_id + } + sds_client.send_request_to_sds(payloads, + exclusions: exclusions_manager.active_exclusions, + extra_headers: extra_headers) + end end # Pass payloads to gem for scanning.