Add logging for keep-around references
What does this MR do and why?
There are already prometheus metrics which give a general idea for rate of keep-arounds being requested/created, but these cannot give any details for specific projects. So here we add logging that will allow us to dig into keep-around workflows.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
The easiest way to trigger keep-arounds is by creating a merge request. Once this is complete you should be able to find the log output in logs/application_json.log
. E.g.
{"severity":"INFO","time":"2024-05-10T00:37:31.340Z","correlation_id":"01HXFYXVX6FX4AG0BKTTT8R2ZH","meta.caller_id":"Mer
geRequestMergeabilityCheckWorker","meta.remote_ip":"127.0.0.1","meta.feature_category":"code_review_workflow","meta.user
":"root","meta.user_id":1,"meta.project":"root/wb","meta.root_namespace":"root","meta.client_id":"user/1","meta.root_cal
ler_id":"Projects::MergeRequests::CreationsController#create","message":"Requesting keep-around reference","object_id":"
5293981aeeea286cc1d0acee6e472172845ca543"}
{"severity":"INFO","time":"2024-05-10T00:37:31.352Z","correlation_id":"01HXFYXVX6FX4AG0BKTTT8R2ZH","meta.caller_id":"Mer
geRequestMergeabilityCheckWorker","meta.remote_ip":"127.0.0.1","meta.feature_category":"code_review_workflow","meta.user
":"root","meta.user_id":1,"meta.project":"root/wb","meta.root_namespace":"root","meta.client_id":"user/1","meta.root_cal
ler_id":"Projects::MergeRequests::CreationsController#create","message":"Requesting keep-around reference","object_id":"
1489777a4d825c02c61742bc0d014696cd4c66f1"}
{"severity":"INFO","time":"2024-05-10T00:37:31.447Z","correlation_id":"01HXFYXVX6FX4AG0BKTTT8R2ZH","meta.caller_id":"Mer
geRequestMergeabilityCheckWorker","meta.remote_ip":"127.0.0.1","meta.feature_category":"code_review_workflow","meta.user
":"root","meta.user_id":1,"meta.project":"root/wb","meta.root_namespace":"root","meta.client_id":"user/1","meta.root_cal
ler_id":"Projects::MergeRequests::CreationsController#create","message":"Created keep-around reference","object_id":"148
9777a4d825c02c61742bc0d014696cd4c66f1"}
Edited by James Fargher