Skip to content

Add repository x-ray usage tracking telemetry

Mikołaj Wawrzyniak requested to merge mwaw/add_telemetry_to_x_ray into master

What does this MR do and why?

Add repository x-ray usage tracking telemetry

The code creation group need measure success of Repository X-Ray feature to gauge changes introduced to this feature. This commit adds internal events tracking to repository x-ray report data being used

Resolves #439791 (closed)

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Create X-Ray report record with via rails c with
project = Project.find_by_full_path("gitlab-org/gitlab-test")
FactoryBot.create(:xray_report, project: project, lang: 'ruby', payload: payload)
  1. With configured code suggestion on your gdk trigger code generation
  curl -X POST -H "Content-Type: Application/json"  -H "Authorization: Bearer $GDK_API_TOKEN" http://gdk.test:3000/api/v4/code_suggestions/completions --data '{   "current_file": {
      "file_name": "utils.rb",
      "content_above_cursor": "# generate function that loads csv",
      "content_below_cursor": ""
    },
    "project_path": "gitlab-org/gitlab-test",
    "intent": "generation"
  }'
  1. Check snowplow micro good events for "se_ac": "include_repository_xray_data_into_code_generation_prompt"

Screenshot_2024-01-25_at_15.01.52

Edited by Matt Nohr

Merge request reports