Send Correlation ID to AI Gateway
Important: this is a high priority MR that is required for Supporting GitLab Duo (chat) for SM and Dedicated (&11251 - closed).
What does this MR do and why?
This MR sends Correlation ID to AI Gateway, so that we can trace the request from GitLab-Rails to AI Gateway.
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
- Ask a question in Duo Chat. See the correlation ID below:
(The correlation ID sent from the client is 01HJMVPNKNKGW1X4D5AD5HZYP6
)
- Corresponding log in AI Gateway:
{
"url": "http://localhost:5052/v1/chat/agent",
"path": "/v1/chat/agent",
"status_code": 200,
"method": "POST",
"correlation_id": "01HJMVPNKNKGW1X4D5AD5HZYP6",
"http_version": "1.1",
"client_ip": "127.0.0.1",
"client_port": 54138,
"duration_s": 2.697260431000359,
"cpu_s": 0.011276617000000044,
"user_agent": "Ruby",
"gitlab_instance_id": "9e210aee-80e2-4f03-86ce-d4bb0fb46455",
"gitlab_global_user_id": "bqtER3xdKMEUpFY0uIH0fTzf5a5WqJWNIfBDNsg2Y9E=",
"gitlab_host_name": "gdk.test",
"gitlab_saas_namespace_ids": null,
"gitlab_realm": "saas",
"meta.feature_category": "duo_chat",
"logger": "api.access",
"level": "info",
"type": "mlops",
"stage": "main",
"timestamp": "2023-12-27T05:24:38.953558Z",
"message": "127.0.0.1:54138 - \"POST /v1/chat/agent HTTP/1.1\" 200"
}
Notice that the same correlation_id
is set.
How to set up and validate locally
See !138274 (merged)
Edited by Shinya Maeda