Add Generic AI Usage Events Aggregation Engine

Summary

Implement a generic aggregation engine for GitLab Duo (AI) usage analytics that provides comprehensive insights across all AI features. This engine will be backed by the existing ai_usage_events ClickHouse table and integrated under the aiUsage GraphQL type, complementing the specific aggregation engines for Code Suggestions and Agent Platform Sessions.

Proposal

Create a new AiUsageEvents generic aggregation engine that will:

  1. Utilize the existing ai_usage_events ClickHouse table
  2. Implement the aggregation engine at ee/app/models/analytics/aggregation_engines/ai_usage_events.rb
  3. Mount the engine on the existing AiUsage GraphQL type
  4. Support cross-feature analytics with the following metrics:

Metrics to Implement

  1. Duo Features Usage (number of users who used Duo)
  2. GitLab Duo Code Review Requests
  3. GitLab Duo Code Review Requests by Role
  4. GitLab Duo Code Review Comments
  5. GitLab Duo Code Review Comments Sentiment
  6. Duo Chat Usage
  7. Duo RCA (Root Cause Analysis) Usage
  8. GitLab Duo Code Review Usage by User
  9. GitLab Duo Root Cause Analysis Usage by User
  10. GitLab Duo Usage by User
  11. Number of unique features used.
Edited by Pavel Shutsin