GitLab-Rails: Track which GitLab version sent a request to AI Gateway
What does this MR do and why?
This MR adds X-Gitlab-Version
to Cloud Connector HTTP headers so that we can track which GL versions of self-managed instances reaching AI Gateway.
AI Gateway counter-part: AI Gateway: track which GitLab version sent a ... (gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!818 - merged)
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
Example log in AI Gateway:
{
"url": "http://localhost:5052/v1/chat/agent",
"path": "/v1/chat/agent",
"status_code": 200,
"method": "POST",
"correlation_id": "9b83f8b4b2c2864d5706086fed408a17",
"http_version": "1.1",
"client_ip": "127.0.0.1",
"client_port": 53838,
"duration_s": 0.5399104749994876,
"duration_request": -1,
"cpu_s": 0.008924422999999848,
"user_agent": "Ruby",
"gitlab_instance_id": "ba75b213-4fd4-4311-8631-0ac7a1bd3247",
"gitlab_global_user_id": "Cv4L37An7TsFzTjzy4yCixBZwUsK8+TCQYl7EYHVN8c=",
"gitlab_host_name": "gdk.test",
"gitlab_version": "17.0.0",
"gitlab_saas_duo_pro_namespace_ids": null,
"gitlab_saas_namespace_ids": null,
"gitlab_realm": "saas",
"meta.feature_category": "duo_chat",
"logger": "api.access",
"level": "info",
"type": "mlops",
"stage": "main",
"timestamp": "2024-05-15T05:17:33.013384Z",
"message": "127.0.0.1:53838 - \"POST /v1/chat/agent HTTP/1.1\" 200"
}
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
Edited by Shinya Maeda