Skip to content

AI Gateway: track which GitLab version sent a request to AI Gateway

Shinya Maeda requested to merge track-x-gitlab-version-header into main

What does this merge request 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.

GitLab-Rails counter-part: GitLab-Rails: Track which GitLab version sent a... (gitlab-org/gitlab!153065 - merged)

How to set up and validate locally

  1. Check out gitlab-org/gitlab!153065 (merged) in GitLab-Rails
  2. Check out this branch in AI Gateway
  3. gdk start
  4. Send a request from GitLab-Rails

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"
}

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.
Edited by Shinya Maeda

Merge request reports