Expose Ai::UsageEvent
to GraphQL AiUsageData
Summary
As part of our effort to bring generalized AI usage data to production-ready state in scope of this issue we need to
Proposal
Expose Ai::UsageEvent
model to GraphQL under AiUsageData
field. PoC can be found in: !194207 (closed)
Technical requirements
- expose
id, user, event, timestamp
fields only. Don't exposeextras
for now. Exposingextras
requires security review. - inherit access rights from
AiUsageData
field. - suggested structure
- The endpoint should be PG-only for now
aiUsageData {
all(possible_filters) {
nodes {
id event timestamp user { username }
}
}
}
- automatically pickup new event types, inherit event type enum from
Ai::UsageEvent.events
- Hide new endpoint behind
unified_ai_events_graphql
derisk feature flag.
Edited by Robert Hunt