Send AI telemetry to GitLab from CodeSuggestion IDE extensions

Problem to solve

Summary

As part of #452173 (closed) we need IDE extensions to additionally send Code Suggestion telemetry metrics to Rails app for further analytics.

Proposal

  1. When #457504 (closed) is done we should adjust IDE extensions to send AI telemetry metrics to new endpoint in Rails app.
  • User IDE privacy settings must be respected
  • The data should go to the instance where the user is authorized. So if users account comes from standalone GitLab instance - data should go to standalone instance. If it's .com then data should to .com
  1. Since we have multiple IDEs support for Code Suggestions this issue might need multiple MRs in multiple repositories.

  2. send all events but for some of them API will return 4xx response code and it should be handled on extension side.

  3. List of events to add:

  • event: string, one of (code_suggestion_accepted_in_ide, code_suggestion_rejected_in_ide, code_suggestion_shown_in_ide)
  • additional_properties[language] string, language of the suggestion
  • additional_properties[branch_name] string, current git branch name of the user
  • additional_properties[unique_tracking_id] string, unique UUID of the suggestion.
  • additional_properties[suggestion_size] number, number of LoC in the suggestion
  • additional_properties[timestamp] timestamp of the event
  • converted by following pattern code_*EVENT*_in_ide
Edited by Haim Snir