Track AI Governance filter changes, tab clicks and flag-gated card links

Follow-up to Add internal events for the AI Governance dashb... (!262058 - merged) (merged), which added internal events for the AI Governance dashboard. This adds what was left: the review on #630644+ asked to also track the DAP vs Connected filter and the 7 vs 30 days filter, and clicks on the page tabs (Tool management, Audit events and so on). It also tracks the links on the four cards that sit behind their own feature flags, which Add internal events for the AI Governance dashb... (!262058 - merged) left for a follow-up. No user-facing change.

What we track, and where

Each number in the screenshot matches a row below. All events carry the user, namespace and project identifiers. Rows 4 and 5 reuse the event from Add internal events for the AI Governance dashb... (!262058 - merged).

# Page The user Event label / property
1 Dashboard Changes the agent filter (All agents, DAP, Connected) apply_filter_on_ai_governance_dashboard label: agent_class, property: all, internal_dap or external
2 Dashboard Changes the date range (Last 7 days, Last 30 days) apply_filter_on_ai_governance_dashboard label: timeframe, property: last_7_days or last_30_days
3 AI Governance page Clicks a tab click_tab_on_ai_governance_page label: dashboard, tool_management, audit_events or mcp_registry
4 Dashboard Clicks the view-all link on Which AI agents developers are using, Most risky skills, Top tools used by agents, or Tool calls by risk click_card_link_on_ai_governance_dashboard label: session_distribution, skillguard, top_tools or tool_calls_by_risk, property: view_all
5 Dashboard Clicks a skill row in Most risky skills click_card_link_on_ai_governance_dashboard label: skillguard, property: row

Not tracked: the default filters on load, a click on the filter option that is already selected, the tab opened from the URL on load, and switching tabs with the arrow keys.

Only Most risky skills has row links among the four cards, so the other three send view_all only.

Dashboard

1-dashboard

  • 1 Changes the agent filter: apply_filter_on_ai_governance_dashboard, label agent_class
  • 2 Changes the date range: same event, label timeframe
  • 3 Clicks a tab: click_tab_on_ai_governance_page
  • 4 Clicks a view-all link on the four cards: click_card_link_on_ai_governance_dashboard, property view_all
  • 5 Clicks a skill row: click_card_link_on_ai_governance_dashboard, property row

Decisions

  • The chosen filter value goes in property, so DAP vs Connected and 7 vs 30 days can be split from one event without a metric per value. The metrics count per filter (agent_class, timeframe).
  • The two filter controls now call a method instead of v-model, so only a change made by the user is sent. The default on load sends nothing, and clicking the option already selected sends nothing. These filters are not read from the URL today.
  • Tab clicks use the tab's click event, not data-event-* attributes like the card links. The tab component stops the click from bubbling, so a data-event-* attribute never reaches the page-level listener. The click event fires only when the user clicks a tab (or presses Space on it), never when the tab is set from ?tab= on load. A click on the tab that is already open counts too.
  • Event names follow Add internal events for the AI Governance dashb... (!262058 - merged): apply_filter_on_ai_audit_events_report there, apply_filter_on_ai_governance_dashboard here.

How to review

  • Start with the table and screenshot.
  • ee/config/events/ (3 files): two new events, and the card link event's label list now names the four new cards.
  • ee/config/metrics/counts_all/ (24 files): a total and a unique-user count per new event (4), per filter label (4), per tab label (8), and per new card label (8). They differ only in event, label and time frame.
  • Vue (6 files): dashboard_app.vue sends the filter event, governance_app.vue the tab event. The SkillGuard and Top tools cards pass the existing tracking-label prop of dashboard_list_card.vue. The two chart cards and the SkillGuard rows get data-event-* attributes directly.
  • Specs (6 files).

Out of scope

  • Derived metrics and the Tableau dashboard, which the data team builds from these events.
  • Row clicks on cards with no row links.

Verification

  • No screenshots of a UI change, since nothing visible changes. The screenshot above only marks where each event fires.
  • Jest: 6 suites, 173 tests pass. 17 of the 20 new tests fail without the change. The other 3 check that nothing is sent.
  • spec/lib/gitlab/usage/metric_definition_validate_all_spec.rb and spec/lib/gitlab/tracking/event_definition_spec.rb pass locally (14 examples, 0 failures). The first validates every metric definition against the schema.
  • ESLint and Prettier clean on the touched files. No new translatable strings.
Edited by Dheeraj Joshi

Merge request reports

Loading
Loading