Show non-billable events in the GitLab Credits user drill-down
What does this MR do and why?
The user drill-down on the GitLab Credits dashboard listed billable events only, so once the total credits used card counts non-billable usage (!265553 (merged)), the event log added up to less than the card and promotional usage left no trace there.
!265819 (merged) adds includeNonBillable to events and usedFlowTypes, and billable/skipReason to each event. This MR is the frontend half:
- The event log queries
events(includeNonBillable: true). A non-billable row shows a neutral badge with its skip reason next to the action, reusing the chart's series labels (Non-billable usage (Promotional), (Beta), (Other) for unknown or missing reasons), so a row reads like its bar. Billable rows are unchanged. - The flow type filter queries
usedFlowTypes(includeNonBillable: true), so flows a user only used without being billed can be filtered on. - The events query drops the deprecated
eventType, which the backend nulls in this mode (CustomersDot complexity cap, see the backend MR);flowTypeis always present, so theflowType || eventTypefallback is gone too. billableandskipReasonare selected with@gl_introduced(version: "19.6.0"); when a backend doesn't report them, no badge is shown.- Jest specs and mock data (one mock event is now non-billable so the stories show the badge).
Stacked on !265819 (merged) and targets its branch. Retarget to master once the backend MR merges, and merge only after the backend has fully rolled out on GitLab.com: this MR sends a new GraphQL argument, which @gl_introduced cannot cover, so a frontend reaching a node without it would fail the events request.
This is change G3 of the plan in #633154 (comment 4099142904). Docs follow in F.
Not changed here: the event log still only lists non-billable events of products this deployment displays, matching the user's nonBillableCreditsUsed. The dashboard's date range is still not passed to the drill-down (pre-existing issue 3 in the issue).
References
- Tracked in https://gitlab.com/gitlab-org/gitlab/-/work_items/636698
- Related to #633154 (closed)
- Plan: #633154 (comment 4099142904)
- Backend half (G2): !265819 (merged)
- CustomersDot (G1): https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/17693
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
-
Check out this branch, which includes !265819 (merged), and https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/17693 in your local CustomersDot.
-
Set up GDK in SaaS mode with that CustomersDot, as in "How to set up and validate locally" in !260725 (merged).
-
In CustomersDot, seed billable and non-billable Orbit usage for one user and enrich:
bin/populate_usage_data -r 20 --realm SaaS --root-namespace-id <id> --user-id <user_id> --feature-qualified-name orbit_mcp --team-member --skip-reason promo bin/populate_usage_data -r 20 --realm SaaS --root-namespace-id <id> --user-id <user_id> --feature-qualified-name orbit_rest -
Visit
/groups/<group>/-/settings/gitlab_credits_dashboard, open Usage by user, open the user. -
The event log interleaves the Orbit MCP rows, each with a Non-billable usage (Promotional) badge; the rows add up to the total credits used card.
-
Open the flow type filter: Orbit - MCP is offered; selecting it keeps only those rows.
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.

