Backend: Display Duo Agent Platform flows by user in usage dashboard

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Update aiUserMetrics GraphQL endpoint to display Duo Agent Platform flow counts by user. The ClickHouse table agent_platform_sessions can be used as a data source to count distinct session_id values grouped by flow_type and user_id. The endpoint needs to support sorting by flowCounts.count.

Sample query

query {
  group(fullPath:"gitlab-org") {
    aiUserMetrics(sort: FLOW_TYPE_COUNT_ASC) {
        user {
          name
        }
        
        agentPlatform {
          ... existing fields
          flowCounts {
            flowName 
            count
          }
        }
      }
    }
  }
}
Edited by Felipe Cardozo