Skip to content

Add AI tracking context fields

What does this MR do and why?

It adds additional context fields for AI events telemetry. These fields will be used for filtering or events grouping.

This MR adds only data gathering, no user facing changes yet. No functionality based on this data yet.

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.

How to set up and validate locally

  1. You need to have clickhouse installed and enabled. You can use this guide
  2. Track event with `Gitlab::Tracking::AiTracking.track_event('code_suggestion_shown_in_ide', user: User.first, suggestion_size: 5, language: 'ruby', unique_tracking_id: 'foobar', timestamp: 1.minute.ago)
  3. Ensure background worker worked off: ClickHouse::CodeSuggestionEventsCronWorker.new.perform
  4. Verify that data is present: ClickHouse::Connection.new(:main).select('SELECT * FROM code_suggestion_usages FINAL ORDER BY timestamp DESC')

Related to #457504 (closed)

Edited by Pavel Shutsin

Merge request reports