Forward caller_id to Gitaly

What does this MR do and why?

This MR forwards caller_id from the Rails ApplicationContext into Gitaly gRPC metadata.

Gitaly logs and metrics cannot show which caller made a request, because the Rails caller_id is never sent. During incident INC-13016, responders could not tell whether elevated Gitaly traffic came from crawlers, background jobs, or real users.

Gitlab::GitalyClient.application_context_metadata already forwards username, user_id, gl_user_id, and remote_ip into Gitaly gRPC metadata. This adds caller_id next to them, using the Labkit::Fields::CALLER_ID constant so the key stays consistent with the field standardization.

The Gitaly side that reads this field and logs it in Gitaly structured logs is a separate MR: gitaly!9092 (merged). Until that lands, the field is sent but not yet logged by Gitaly.

For GraphQL requests the caller_id is more useful once !250311 (merged) lands, which sets caller_id to the operation.

MR acceptance checklist

Please refer to the MR acceptance checklist for review guidance.

Edited by Stan Hu

Merge request reports

Loading
Loading