From 8b2474e582372cd4cffac797329ffdf6ab510776 Mon Sep 17 00:00:00 2001 From: Dante Date: Wed, 14 Oct 2026 20:21:22 +0000 Subject: [PATCH] FE-3443 feat(telemetry): stable RUM action names on billing CTAs (#21007) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Why QA hit plan-upgrade buttons that did nothing: no request, no console error (FE-3441, fixed in #21004). We only learned about it from a manual report. Datadog RUM already records `dead_click` / `error_click` / `rage_click` in prod, but it names each action by the button's visible text. In the last 24h the same billing CTA showed up as `Choose a Plan`, `Choose a Plan For Personal For Teams …`, `Add credits`, `Add credits View pricing details`, and so on, and a localized UI produces yet another name. A monitor cannot target billing buttons reliably. ## How - New `src/platform/telemetry/billingActionNames.ts` with fixed `billing.*` names, one per CTA, plus `planCtaActionName(tierKey)` for the per-tier plan buttons. - Each billing CTA gets `data-dd-action-name`, which the RUM SDK reads by default (no init change): - add credits: popover (legacy + workspace), credits tile, status banner - top-up dialog primary (Add credits / Pay $X) - plan CTAs in `PricingTable`, `PricingTableWorkspace`, `UnifiedPricingTable` (per tier, plus the team plan CTA) - Subscribe to Run, topbar Subscribe, popover Manage plan, panel Upgrade/Change plan - `Button` already forwards `$attrs` to the rendered element. Follow-up, not in this PR: a Datadog monitor on `@action.frustration.type:(dead_click OR error_click) @action.target.name:billing.*`, with its threshold set from the baseline once this ships. ## AS IS / TO BE AS IS (main): billing buttons carry no `data-dd-action-name`, so RUM names each click by its visible text. Prod RUM, last 24h, frustration clicks matching `@action.target.name:(*Plan* OR *credits* OR *Subscribe*)` grouped by `@action.target.name`: the same CTAs split across many text-based names (`Add credits`, `Add credits View pricing details`, `0 Add credits`, `10,353 Add credits`, `Choose a Plan For Personal For Teams …`, plus a Spanish-localized name). AS IS: RUM toplist by action.target.name Same plan CTAs rendered from main's `UnifiedPricingTable.vue` (Storybook `Components/UnifiedPricingTable` Personal story, branch base d3818ea6b8): no `data-dd-action-name` on the buttons. AS IS: plan CTAs without data-dd-action-name TO BE (this branch), same Storybook stories rendered in headless Chrome, buttons outlined, rendered attributes listed below the table. Plan CTAs carry `billing.plan_cta.` and the team CTA carries `billing.plan_cta.team`, independent of label and locale. TO BE: Personal plan CTAs with billing.plan_cta.* TO BE: Team plan CTA with billing.plan_cta.team Route: Storybook, because the popover, topbar and credits buttons need a signed-in cloud account. The topbar Subscribe button (`billing.subscribe.topbar`) is covered by `TopbarSubscribeButton.test.ts` rather than a screenshot. ## Tests - `billingActionNames.test.ts`: every name sits under `billing.`, no two CTAs share a name. - `TopbarSubscribeButton.test.ts`: the rendered button carries `billing.subscribe.topbar`. Fails when the attribute is removed. - `src/components/topbar`, `src/platform/cloud/subscription/components`, `src/platform/workspace/components`: 892 tests pass. - Fixes FE-3443 --- .../topbar/CurrentUserPopoverLegacy.vue | 2 ++ .../topbar/TopbarSubscribeButton.test.ts | 9 +++++++++ .../topbar/TopbarSubscribeButton.vue | 2 ++ .../subscription/components/CreditsTile.vue | 2 ++ .../subscription/components/PricingTable.vue | 2 ++ .../components/SubscribeToRun.vue | 2 ++ .../telemetry/billingActionNames.test.ts | 20 +++++++++++++++++++ src/platform/telemetry/billingActionNames.ts | 16 +++++++++++++++ .../CurrentUserPopoverWorkspace.vue | 3 +++ .../components/PricingTableWorkspace.vue | 2 ++ .../SubscriptionPanelContentWorkspace.vue | 2 ++ .../TopUpCreditsDialogContentWorkspace.vue | 2 ++ .../components/UnifiedPricingTable.vue | 6 ++++++ .../dialogs/settings/BillingStatusBanner.vue | 2 ++ 14 files changed, 72 insertions(+) create mode 100644 src/platform/telemetry/billingActionNames.test.ts create mode 100644 src/platform/telemetry/billingActionNames.ts diff --git a/src/components/topbar/CurrentUserPopoverLegacy.vue b/src/components/topbar/CurrentUserPopoverLegacy.vue index 54e872a8b5e..7b44b599067 100644 --- a/src/components/topbar/CurrentUserPopoverLegacy.vue +++ b/src/components/topbar/CurrentUserPopoverLegacy.vue @@ -98,6 +98,7 @@ size="sm" class="text-base-foreground" data-testid="add-credits-button" + :data-dd-action-name="BILLING_ACTION_NAME.addCreditsPopover" @click="handleTopUp" > {{ $t('subscription.addCredits') }} @@ -157,6 +158,7 @@