Add Flows usage table to GitLab Duo and SDLC trends dashboard
What does this MR do and why?
This change adds a new data table to GitLab's AI analytics dashboard that shows usage metrics for different AI agent workflow types. The table displays information like how many sessions each workflow had, average execution time, number of unique users, and completion rates. The data can be sorted by different columns, and the table is limited to showing the top 10 results. This gives teams visibility into how their AI agents are performing across different types of automated workflows.
References
Screenshots or screen recordings
Screen_Recording_2025-12-10_at_9.44.11_AM
How to set up and validate locally
- Apply this diff to mock the table data:
diff --git a/ee/app/graphql/resolvers/analytics/ai_metrics/agent_platform/flow_metrics_resolver.rb b/ee/app/graphql/resolvers/analytics/ai_metrics/agent_platform/flow_metrics_resolver.rb
index 4804d6679536..e9b82ca8f249 100644
--- a/ee/app/graphql/resolvers/analytics/ai_metrics/agent_platform/flow_metrics_resolver.rb
+++ b/ee/app/graphql/resolvers/analytics/ai_metrics/agent_platform/flow_metrics_resolver.rb
@@ -10,15 +10,18 @@ class FlowMetricsResolver < BaseResolver
type [::Types::Analytics::AiMetrics::AgentPlatform::FlowMetricsType], null: true
def resolve_with_lookahead
- flow_metrics = ::Analytics::AiAnalytics::AgentPlatform::FlowMetricsService.new(
- current_user,
- namespace: context[:ai_metrics_namespace],
- from: context[:ai_metrics_params][:start_date],
- to: context[:ai_metrics_params][:end_date],
- fields: lookahead.selections.map(&:name)
- ).execute
+ # Mock data with 100 randomized records
+ flow_types = ['chat', 'code_review', 'fix_pipeline', 'explain_code', 'refactor_code']
- flow_metrics.payload
+ 100.times.map do
+ {
+ 'flow_type' => flow_types.sample,
+ 'sessions_count' => rand(1..5000),
+ 'median_execution_time' => rand(5.0..300.0).round(1),
+ 'users_count' => rand(1..500),
+ 'completion_rate' => rand(30.0..100.0).round(1)
+ }
+ end
end
end
end
- Navigate to the Duo and SDLC trends dashboard for any group/project
- Scroll down to the Flow usage table (below pipeline metrics)
- Data should render and be sortable by
Number of sessions,Avg median durationandUnique users
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #581554