Add instrumentation logger for Ci::RegisterJobService
What does this MR do and why?
Ci::RegisterJobService sometimes takes a longer time than it should.
However, it's not easy to debug the slowness with the current
instrumentation tools.
In this change, we are adding a new logger, inspired by the Pipeline Logger, to this service.
Currently, the log condition is 5 seconds. And it's behind an ops
feature flag; ci_register_job_instrumentation_logger. #512402
Related to #450674+
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.
Screenshots or screen recordings
{
"severity": "INFO",
"time": "2025-01-09T10:02:46.768Z",
"correlation_id": "01JH5884JDPNG8PKBBTE2SMB22",
"meta.caller_id": "POST /api/:version/jobs/request",
"meta.remote_ip": "127.0.0.1",
"meta.feature_category": "continuous_integration",
"meta.http_router_rule_action": "proxy",
"meta.user": "root",
"meta.user_id": 1,
"meta.project": "root/basic",
"meta.root_namespace": "root",
"meta.client_id": "runner/27",
"meta.pipeline_id": 1388,
"meta.job_id": 73110,
"class": "Ci::RegisterJobService::Logger",
"message": "RegisterJobService exceeded maximum duration",
"total_duration_s": 9.745669999625534,
"runner_id": 27,
"retrieve_queue_duration_s": {
"count": 1,
"max": 3.0118619999848306,
"sum": 3.0118619999848306
},
"process_build_duration_s": {
"count": 1,
"max": 3.7078539999201894,
"sum": 3.7078539999201894
},
"process_queue_duration_s": 9.745248999912292
}