Add GLQL parser support for AiUsageEvent analytics mode

Summary

Add parser support for AiUsageEvent with mode: analytics syntax in GLQL. This enables users to write analytics queries for GitLab Duo usage patterns, feature adoption, and AI interaction metrics.

Example Query

mode: analytics
query: type = AiUsageEvent and group = "gitlab-org" and feature = "chat" and timestamp >= -30d
dimensions: feature, timestamp(weekly)
metrics: totalCount, usersCount
sort: totalCount desc
limit: 20

Implementation Details

Updated to match the engine that shipped: the engine is mounted as analytics.duoUsageEvents. Dimensions are feature, event, user, timestamp(granularity: daily|weekly|monthly). Metrics are totalCount, usersCount, featuresCount, returningUsersCount, previousPeriodUsersCount. The original example's userRole and averageSentiment don't exist in the engine, and count/uniqueUsers are totalCount/usersCount. Parser/codegen/transformer are already generic over analytics sources, so the change is a new source analyzer plus type wiring. The glql_ai_usage_event_analytics_aggregation feature flag was never created; the source ships unflagged like the other analytics sources.

Dependencies

Acceptance Criteria

  • Parser recognizes type: AiUsageEvent with mode: analytics
  • Dimensions and metrics are parsed correctly
  • Generated GraphQL query matches aggregation schema
  • Response transformer handles aggregated data format
  • Error messages are helpful for invalid syntax
Edited by Robert Hunt