Skip to content

FE-3109 feat(billing-web): bootstrap PostHog and the billing event facade - #19689

Merged
dante01yoon merged 2 commits into
jaewon/fe-3109-billing-web-datadog-rum-bootstrapfrom
jaewon/fe-3109-billing-web-telemetry-bootstrap-datadog-rum-and-posthog
Oct 1, 2026
Merged

dante01yoon merged 2 commits into
jaewon/fe-3109-billing-web-datadog-rum-bootstrapfrom
jaewon/fe-3109-billing-web-telemetry-bootstrap-datadog-rum-and-posthog

Conversation

@dante01yoon

@dante01yoon dante01yoon commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Second half of the billing web telemetry bootstrap, stacked on #19688 (its base is that branch until it merges): initialize PostHog in billing web with the cloud app's configuration and add the billing event facade that later tickets call to send billing.<operation>.<stage> events to RUM and PostHog, stamped billing_surface: 'billing_web'.

Why

Rollout analytics live in PostHog (decision D11), and a billing web event is only useful if it reaches PostHog next to the cloud app's events and joins the same person. Billing web has no PostHog and no single place to send billing events from.

How

  • Config. PostHog's token, host and the telemetry_disabled_events opt-out are read from the same cloud-origin /api/features fetch billing web already makes for Firebase (parsed once in account-core), so the cloud app stays the single source of truth. When no token is returned, PostHog stays off.
  • Lazy load. posthog-js loads in a separate chunk, so the first-load bundle is unaffected. Events sent while it loads wait in a bounded queue (50) and are flushed, or dropped if PostHog turns out to be off.
  • Privacy. Same sanitizer as the cloud app, plus: session recording, performance and web-vitals capture, heatmaps, dead clicks, exception capture and external script loading are off; promo and the Stripe return parameters are masked wherever PostHog stores a URL, its cross-subdomain cookie included; person_profiles is identified_only.
  • Identity. The cookie is shared across *.comfy.org, so it may already name someone. Billing web identifies with the user id once a session exists, resets if the cookie names a different identified user, and resets on sign-out only for a user it identified itself, so a visitor never signed in here keeps the cloud identity. A refused or still-resolving session says nothing about who is signed in.
  • Facade. billingWebTelemetry.trackBillingEvent(name, payload) sends one event to RUM (as an action) and PostHog, stamps billing_surface: 'billing_web', never throws into the billing flow, and does nothing when telemetry is off. It takes the cloud contract's allowlisted payload as input.
  • Shared. The PostHog base options and default host moved into @comfyorg/shared-frontend-utils/telemetry; the cloud provider imports them with no behavior change.

Review Focus

  • Stacked on FE-3109 feat(billing-web): bootstrap Datadog RUM #19688: review the last two commits only. After FE-3109 feat(billing-web): bootstrap Datadog RUM #19688 merges, this PR's base moves to main.
  • person_profiles: the cloud's server-side PostHog config sets person_profiles: 'always', so production cloud does not run the identified_only our constraints say it does. Billing web ignores that override and stays identified_only. The cloud difference is not changed here.
  • The typed event contract is not shared yet: src/platform/telemetry/types.ts imports cloud-only types, so billing web cannot import it, and moving it would edit the allowlist that FE-3111 feat(billing): stamp billing_surface and billing_client where the emitter knows its rail #19685 is changing. The facade therefore takes the contract's output (event name and allowlisted payload). The contract move should land after FE-3111 feat(billing): stamp billing_surface and billing_client where the emitter knows its rail #19685 and before FE-3117; a ticket is to be filed.
  • Cloud PostHog pageviews carry full URLs and cloud RUM records the user's email. Billing web does neither. Moving the cloud onto the shared scrub needs its own ticket.
  • Size: about 315 added non-test lines, a little over the usual limit. If it needs trimming, the account-core config parse (about 35 lines) can go first as its own PR.
  • No deployment configuration is needed: all three cloud origins already return the PostHog token and host, and none returns telemetry_disabled_events. FRONTEND_COMMIT_HASH is an optional override for the version.
  • UnifiedPricingTable.test.ts ("prompts free-tier users to subscribe") fails locally on origin/main too (INTERNAL ASSERTION FAILED: Expected a class definition, local Node 24 against engine 26). This diff does not touch it.

AS IS / TO BE

AS IS: AS IS at 84734e29b2: the stub sends nothing. trackBillingEvent(billing.subscription_checkout.started) makes 0 PostHog captures and 0 RUM actions, nothing is queued or flushed, posthog.init and identify/reset are never called, before_send never runs, and resolveCloudTelemetryConfig returns no PostHog fields; 16 of 129 tests in the three touched files fail

TO BE: TO BE at 2b0c877e30: billing.subscription_checkout.started reaches PostHog and RUM stamped billing_surface billing_web; an event tracked while PostHog loads is held then flushed; with no token PostHog never initializes; a disabled event is held back from PostHog only; a different cookie user is reset before identify, sign-out resets only a user identified here; init turns off recording, performance, heatmaps, dead clicks, exceptions and external scripts, masks promo and Stripe params, uses person_profiles identified_only; 129 of 129 tests pass

The evidence is what billing web sends to PostHog and RUM for a representative billing event, a Stripe return URL and a sign-in/sign-out sequence, before (nothing sent) and after.

Where this sits in the plan

Linear: FE-3109, part of FE-3105. Plan, event catalog and dependency graph: action items.

Task Ticket What Status
T1 FE-3107 Decide vocabulary and dimensions decided, SSOT page pending
T2 FE-3108 Decide RUM application and env mapping decided
T3 FE-3109 Billing web telemetry bootstrap (RUM and PostHog) this PR
T4, F1 FE-3106 SDK-rail ownership PR 19620, merged
T4, F2 FE-3110 Keep operation id and fields in the mapper PR 19623, merged
T4, F3 FE-3111 Stamp billing_surface and billing_client PR 19685, in review
T4, F5 FE-3112 SDK top-up terminals PR 19628, merged
T4, F6 FE-3113 Downgrade reconciliation terminal PR 19622, merged
T4, F7 FE-3114 Legacy personal-rail events, first slice PR 19627, merged
T4, F7+ FE-3131 Legacy personal-rail events, remaining slices PR 19686, in review
T5 FE-3115 Cloud entry fidelity and Datadog parity todo
T6 FE-3116 Handoff contract and event PR 19687, in review
T7 FE-3117 Billing web attempt lifecycle todo
T8 FE-3118 Billing web journey and choices todo
T9 FE-3119 Payment friction events todo
T10 FE-3120 Billing web entry, session and return todo
T11 FE-3121 Portal events todo
T12 FE-3122 Flag coverage check todo
T13 FE-3123 PostHog rollout dashboard todo
T14 FE-3124 Datadog tiles in the Frontend RUM dashboard todo
T15 FE-3125 Verification per flow todo
T16 FE-3126 Rollout plan todo
flowchart LR
  subgraph DEC["Decided"]
    T1["FE-3107 T1 vocabulary"]
    T2["FE-3108 T2 RUM app and env"]
  end
  subgraph FIX["Existing events (T4)"]
    F1["FE-3106 F1 SDK-rail ownership"]
    F2["FE-3110 F2 mapper fields"]
    F3["FE-3111 F3 surface and client"]
    F5["FE-3112 F5 top-up terminals"]
    F6["FE-3113 F6 downgrade terminal"]
    F7["FE-3114 F7 legacy personal, first slice"]
    F7B["FE-3131 F7 remaining slices"]
  end
  subgraph EMIT["New events"]
    T3["FE-3109 T3 billing web bootstrap"]
    T5["FE-3115 T5 cloud entry and parity"]
    T6["FE-3116 T6 handoff contract"]
    T7["FE-3117 T7 attempt lifecycle"]
    T8["FE-3118 T8 journey and choices"]
    T9["FE-3119 T9 friction"]
    T10["FE-3120 T10 entry, session, return"]
    T11["FE-3121 T11 portal"]
    T12["FE-3122 T12 flag coverage"]
  end
  subgraph DASH["Dashboards"]
    T13["FE-3123 T13 PostHog rollout"]
    T14["FE-3124 T14 Frontend RUM tiles"]
  end
  T15["FE-3125 T15 verification"]
  T16["FE-3126 T16 rollout plan"]
  T2 --> T3
  T1 --> F3
  T1 --> T5
  T1 --> T6
  T1 --> T13
  T1 --> T14
  T2 --> T14
  F2 --> T7
  T3 --> T7
  T3 --> T8
  T3 --> T10
  T3 --> T11
  T3 --> T12
  T5 --> T11
  T6 --> T8
  T6 --> T10
  T7 --> T9
  T8 --> T9
  F1 --> T13
  F3 --> T13
  FIX --> T15
  T5 --> T15
  T9 --> T15
  T10 --> T15
  T11 --> T15
  T12 --> T15
  T13 --> T15
  T14 --> T15
  T13 --> T16
  T15 --> T16
  style T3 stroke-width:3px
Loading

@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 975a07be-e72b-4c7a-8c41-5ed42d5038f6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright: ✅ 2176 passed, 0 failed · 1 flaky

📊 Browser Reports
  • chromium: View Report (✅ 2155 / ❌ 0 / ⚠️ 1 / ⏭️ 0)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 10/01/2026, 12:58:41 AM UTC

Links

🌾 Fallow: ✅ Passed

Fallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened.

No new findings in the changed files.

Reproduce locally
# the base the gate compared against
npx fallow audit --root . --quiet --format json \
  --changed-since 272b392bbb100db0a5bc71e2fbdf341b6ce1f65e

Full docs: ADR-DEVEX-LINT-0015

🧩 Custom Nodes Ecosystem Matrix: ✅ Passed

Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.

Stage Result What a failure here means
pin-status success Informational. It never fails the build; it warns when the corpus snapshot is over 30 days old.
corpus success Infrastructure: the pack mirror could not be fetched, validated or cached. Not your diff.
shards success Harness integrity, not pack breakage. A shard only checks that every built spec wrote its row; vitest's own exit code is deliberately ignored because pack code leaks unhandled rejections.
verdicts success The population verdict per renderer. This is the stage that judges packs. Exit 1 is FAIL; exit 2 is withheld — rows were missing, so nothing was measured, which is not the same as your change breaking packs.
detection-proofs success The instrument self-test: the matrix must FAIL on a deliberately poisoned corpus. A failure here means the gate cannot be trusted this run, in either direction.

On a pin-bump PR, a red gate means the ecosystem moved — not that your diff broke something. That is what the bump PR is for. Outside a pin bump or a cold rebuild of the unpinned tail, a red means the diff.

Note the corpus size and the executed count are different numbers, and the verdict is against the executed count: roughly 3,100 of ~5,100 packs ship no extension-shaped JS and are skipped.

Reproduce locally
# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
  npx vitest run --config vitest.matrix.config.mts

Full docs: scripts/registry-census/README.md

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance Report

canvas-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 70.5 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 67.6 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 62.9 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 66.7 MB heap
dom-widget-order-dense-n200-w200-i120: · 33.2 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 400ms TBT · 85.1 MB heap
dom-widget-order-sparse-n1000-w20-i120: · 43.1 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 165ms TBT · 102.9 MB heap
extension-clean-combined-draw: · 39.0 avg FPS · 20.0 P5 FPS ❌ (target: ≥52) · 47ms TBT · 84.3 MB heap
extension-rgthree-prototype-draw: · 40.9 avg FPS · 29.9 P5 FPS ❌ (target: ≥52) · 63ms TBT · 89.8 MB heap
large-graph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 78.5 MB heap
large-graph-pan: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 72.5 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 69.4 MB heap
legacy-node-drag: · 59.6 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 78.3 MB heap
minimap-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 76.6 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 63.4 MB heap
subgraph-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 72.0 MB heap
subgraph-mouse-sweep: · 59.7 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 65.2 MB heap
subgraph-transition-enter: · 51.3 avg FPS · 29.9 P5 FPS ❌ (target: ≥52) · 91ms TBT · 101.4 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 77.1 MB heap
vue-large-graph-idle: · 37.4 avg FPS · 20.0 P5 FPS ❌ (target: ≥52) · 0ms TBT · 180.7 MB heap
vue-large-graph-pan: · 29.4 avg FPS · 15.0 P5 FPS ❌ (target: ≥52) · 6ms TBT · 177.5 MB heap
vue-node-resize-workload: · 30.6 avg FPS · 15.0 P5 FPS ❌ (target: ≥52) · 0ms TBT · 202.4 MB heap
vue-zoom-out-idle: · 36.7 avg FPS · 20.0 P5 FPS ❌ (target: ≥52) · 0ms TBT · 185.1 MB heap
workflow-execution: · 57.1 avg FPS · 40.0 P5 FPS ❌ (target: ≥52) · 0ms TBT · 54.2 MB heap
agent-composer-empty-conversation-typing: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 77.3 MB heap
agent-composer-long-conversation-typing: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 103.6 MB heap

ℹ️ No baseline found — significance unavailable.

Absolute values
Metric Value
canvas-idle: avg frame time 17ms
canvas-idle: p95 frame time 17ms
canvas-idle: layout duration 0ms
canvas-idle: style recalc duration 4ms
canvas-idle: layout count 0
canvas-idle: style recalc count 10
canvas-idle: task duration 438ms
canvas-idle: script duration 12ms
canvas-idle: TBT 0ms
canvas-idle: heap used 70.5 MB
canvas-idle: DOM nodes -232
canvas-idle: event listeners -133
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 4ms
canvas-mouse-sweep: style recalc duration 16ms
canvas-mouse-sweep: layout count 12
canvas-mouse-sweep: style recalc count 63
canvas-mouse-sweep: task duration 720ms
canvas-mouse-sweep: script duration 132ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 67.6 MB
canvas-mouse-sweep: DOM nodes -116
canvas-mouse-sweep: event listeners -82
canvas-zoom-sweep: avg frame time 17ms
canvas-zoom-sweep: p95 frame time 17ms
canvas-zoom-sweep: layout duration 1ms
canvas-zoom-sweep: style recalc duration 10ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 31
canvas-zoom-sweep: task duration 342ms
canvas-zoom-sweep: script duration 14ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 62.9 MB
canvas-zoom-sweep: DOM nodes -63
canvas-zoom-sweep: event listeners -67
dom-widget-clipping: avg frame time 17ms
dom-widget-clipping: p95 frame time 17ms
dom-widget-clipping: layout duration 0ms
dom-widget-clipping: style recalc duration 3ms
dom-widget-clipping: layout count 0
dom-widget-clipping: style recalc count 12
dom-widget-clipping: task duration 392ms
dom-widget-clipping: script duration 142ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 66.7 MB
dom-widget-clipping: DOM nodes 0
dom-widget-clipping: event listeners 0
dom-widget-order-dense-n200-w200-i120: avg frame time 30ms
dom-widget-order-dense-n200-w200-i120: p95 frame time 17ms
dom-widget-order-dense-n200-w200-i120: layout duration 0ms
dom-widget-order-dense-n200-w200-i120: style recalc duration 0ms
dom-widget-order-dense-n200-w200-i120: layout count 0
dom-widget-order-dense-n200-w200-i120: style recalc count 0
dom-widget-order-dense-n200-w200-i120: task duration 678ms
dom-widget-order-dense-n200-w200-i120: script duration 54ms
dom-widget-order-dense-n200-w200-i120: TBT 400ms
dom-widget-order-dense-n200-w200-i120: heap used 85.1 MB
dom-widget-order-dense-n200-w200-i120: DOM nodes 0
dom-widget-order-dense-n200-w200-i120: event listeners 0
dom-widget-order-sparse-n1000-w20-i120: avg frame time 23ms
dom-widget-order-sparse-n1000-w20-i120: p95 frame time 17ms
dom-widget-order-sparse-n1000-w20-i120: layout duration 0ms
dom-widget-order-sparse-n1000-w20-i120: style recalc duration 0ms
dom-widget-order-sparse-n1000-w20-i120: layout count 0
dom-widget-order-sparse-n1000-w20-i120: style recalc count 0
dom-widget-order-sparse-n1000-w20-i120: task duration 408ms
dom-widget-order-sparse-n1000-w20-i120: script duration 123ms
dom-widget-order-sparse-n1000-w20-i120: TBT 165ms
dom-widget-order-sparse-n1000-w20-i120: heap used 102.9 MB
dom-widget-order-sparse-n1000-w20-i120: DOM nodes 0
dom-widget-order-sparse-n1000-w20-i120: event listeners 0
extension-clean-combined-draw: avg frame time 26ms
extension-clean-combined-draw: p95 frame time 50ms
extension-clean-combined-draw: layout duration 0ms
extension-clean-combined-draw: style recalc duration 0ms
extension-clean-combined-draw: layout count 0
extension-clean-combined-draw: style recalc count 0
extension-clean-combined-draw: task duration 6764ms
extension-clean-combined-draw: script duration 5384ms
extension-clean-combined-draw: TBT 47ms
extension-clean-combined-draw: heap used 84.3 MB
extension-clean-combined-draw: DOM nodes 0
extension-clean-combined-draw: event listeners 0
extension-rgthree-prototype-draw: avg frame time 24ms
extension-rgthree-prototype-draw: p95 frame time 33ms
extension-rgthree-prototype-draw: layout duration 0ms
extension-rgthree-prototype-draw: style recalc duration 0ms
extension-rgthree-prototype-draw: layout count 0
extension-rgthree-prototype-draw: style recalc count 1
extension-rgthree-prototype-draw: task duration 6726ms
extension-rgthree-prototype-draw: script duration 5273ms
extension-rgthree-prototype-draw: TBT 63ms
extension-rgthree-prototype-draw: heap used 89.8 MB
extension-rgthree-prototype-draw: DOM nodes -71
extension-rgthree-prototype-draw: event listeners -37
large-graph-idle: avg frame time 17ms
large-graph-idle: p95 frame time 17ms
large-graph-idle: layout duration 0ms
large-graph-idle: style recalc duration 5ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 9
large-graph-idle: task duration 580ms
large-graph-idle: script duration 34ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 78.5 MB
large-graph-idle: DOM nodes -328
large-graph-idle: event listeners -153
large-graph-pan: avg frame time 17ms
large-graph-pan: p95 frame time 17ms
large-graph-pan: layout duration 0ms
large-graph-pan: style recalc duration 11ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 69
large-graph-pan: task duration 1384ms
large-graph-pan: script duration 665ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 72.5 MB
large-graph-pan: DOM nodes -164
large-graph-pan: event listeners -80
large-graph-zoom: avg frame time 17ms
large-graph-zoom: p95 frame time 17ms
large-graph-zoom: layout duration 14ms
large-graph-zoom: style recalc duration 12ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 63
large-graph-zoom: task duration 1464ms
large-graph-zoom: script duration 643ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 69.4 MB
large-graph-zoom: DOM nodes -164
large-graph-zoom: event listeners 0
legacy-node-drag: avg frame time 17ms
legacy-node-drag: p95 frame time 17ms
legacy-node-drag: layout duration 0ms
legacy-node-drag: style recalc duration 6ms
legacy-node-drag: layout count 0
legacy-node-drag: style recalc count 44
legacy-node-drag: task duration 1633ms
legacy-node-drag: script duration 789ms
legacy-node-drag: TBT 0ms
legacy-node-drag: heap used 78.3 MB
legacy-node-drag: DOM nodes 0
legacy-node-drag: event listeners 180
minimap-idle: avg frame time 17ms
minimap-idle: p95 frame time 17ms
minimap-idle: layout duration 0ms
minimap-idle: style recalc duration 3ms
minimap-idle: layout count 0
minimap-idle: style recalc count 7
minimap-idle: task duration 453ms
minimap-idle: script duration 32ms
minimap-idle: TBT 0ms
minimap-idle: heap used 76.6 MB
minimap-idle: DOM nodes -164
minimap-idle: event listeners 0
subgraph-dom-widget-clipping: avg frame time 17ms
subgraph-dom-widget-clipping: p95 frame time 17ms
subgraph-dom-widget-clipping: layout duration 0ms
subgraph-dom-widget-clipping: style recalc duration 6ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 48
subgraph-dom-widget-clipping: task duration 356ms
subgraph-dom-widget-clipping: script duration 123ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 63.4 MB
subgraph-dom-widget-clipping: DOM nodes -125
subgraph-dom-widget-clipping: event listeners -99
subgraph-idle: avg frame time 17ms
subgraph-idle: p95 frame time 17ms
subgraph-idle: layout duration 0ms
subgraph-idle: style recalc duration 5ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 9
subgraph-idle: task duration 422ms
subgraph-idle: script duration 10ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 72.0 MB
subgraph-idle: DOM nodes -250
subgraph-idle: event listeners -210
subgraph-mouse-sweep: avg frame time 17ms
subgraph-mouse-sweep: p95 frame time 17ms
subgraph-mouse-sweep: layout duration 6ms
subgraph-mouse-sweep: style recalc duration 17ms
subgraph-mouse-sweep: layout count 16
subgraph-mouse-sweep: style recalc count 67
subgraph-mouse-sweep: task duration 666ms
subgraph-mouse-sweep: script duration 99ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 65.2 MB
subgraph-mouse-sweep: DOM nodes -125
subgraph-mouse-sweep: event listeners -105
subgraph-transition-enter: avg frame time 19ms
subgraph-transition-enter: p95 frame time 33ms
subgraph-transition-enter: layout duration 10ms
subgraph-transition-enter: style recalc duration 24ms
subgraph-transition-enter: layout count 5
subgraph-transition-enter: style recalc count 17
subgraph-transition-enter: task duration 742ms
subgraph-transition-enter: script duration 23ms
subgraph-transition-enter: TBT 91ms
subgraph-transition-enter: heap used 101.4 MB
subgraph-transition-enter: DOM nodes 13747
subgraph-transition-enter: event listeners 2383
viewport-pan-sweep: avg frame time 17ms
viewport-pan-sweep: p95 frame time 17ms
viewport-pan-sweep: layout duration 0ms
viewport-pan-sweep: style recalc duration 36ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 250
viewport-pan-sweep: task duration 4872ms
viewport-pan-sweep: script duration 2201ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 77.1 MB
viewport-pan-sweep: DOM nodes -328
viewport-pan-sweep: event listeners -142
vue-large-graph-idle: avg frame time 27ms
vue-large-graph-idle: p95 frame time 50ms
vue-large-graph-idle: layout duration 0ms
vue-large-graph-idle: style recalc duration 0ms
vue-large-graph-idle: layout count 0
vue-large-graph-idle: style recalc count 0
vue-large-graph-idle: task duration 14547ms
vue-large-graph-idle: script duration 233ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 180.7 MB
vue-large-graph-idle: DOM nodes -3046
vue-large-graph-idle: event listeners -14915
vue-large-graph-pan: avg frame time 34ms
vue-large-graph-pan: p95 frame time 67ms
vue-large-graph-pan: layout duration 0ms
vue-large-graph-pan: style recalc duration 19ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 136
vue-large-graph-pan: task duration 17515ms
vue-large-graph-pan: script duration 813ms
vue-large-graph-pan: TBT 6ms
vue-large-graph-pan: heap used 177.5 MB
vue-large-graph-pan: DOM nodes -3045
vue-large-graph-pan: event listeners -14915
vue-node-resize-workload: avg frame time 33ms
vue-node-resize-workload: p95 frame time 67ms
vue-node-resize-workload: layout duration 24ms
vue-node-resize-workload: style recalc duration 63ms
vue-node-resize-workload: layout count 20
vue-node-resize-workload: style recalc count 20
vue-node-resize-workload: task duration 5350ms
vue-node-resize-workload: script duration 92ms
vue-node-resize-workload: TBT 0ms
vue-node-resize-workload: heap used 202.4 MB
vue-node-resize-workload: DOM nodes 0
vue-node-resize-workload: event listeners 0
vue-zoom-out-idle: avg frame time 27ms
vue-zoom-out-idle: p95 frame time 50ms
vue-zoom-out-idle: layout duration 0ms
vue-zoom-out-idle: style recalc duration 0ms
vue-zoom-out-idle: layout count 0
vue-zoom-out-idle: style recalc count 0
vue-zoom-out-idle: task duration 7394ms
vue-zoom-out-idle: script duration 114ms
vue-zoom-out-idle: TBT 0ms
vue-zoom-out-idle: heap used 185.1 MB
vue-zoom-out-idle: DOM nodes -3045
vue-zoom-out-idle: event listeners -14915
workflow-execution: avg frame time 18ms
workflow-execution: p95 frame time 25ms
workflow-execution: layout duration 2ms
workflow-execution: style recalc duration 16ms
workflow-execution: layout count 4
workflow-execution: style recalc count 14
workflow-execution: task duration 132ms
workflow-execution: script duration 12ms
workflow-execution: TBT 0ms
workflow-execution: heap used 54.2 MB
workflow-execution: DOM nodes 7
workflow-execution: event listeners -33
agent-composer-empty-conversation-typing: avg frame time 17ms
agent-composer-empty-conversation-typing: p95 frame time 17ms
agent-composer-empty-conversation-typing: layout duration 23ms
agent-composer-empty-conversation-typing: style recalc duration 89ms
agent-composer-empty-conversation-typing: layout count 76
agent-composer-empty-conversation-typing: style recalc count 78
agent-composer-empty-conversation-typing: task duration 585ms
agent-composer-empty-conversation-typing: script duration 215ms
agent-composer-empty-conversation-typing: TBT 0ms
agent-composer-empty-conversation-typing: heap used 77.3 MB
agent-composer-empty-conversation-typing: DOM nodes 76
agent-composer-empty-conversation-typing: event listeners 876
agent-composer-long-conversation-typing: avg frame time 17ms
agent-composer-long-conversation-typing: p95 frame time 17ms
agent-composer-long-conversation-typing: layout duration 27ms
agent-composer-long-conversation-typing: style recalc duration 258ms
agent-composer-long-conversation-typing: layout count 76
agent-composer-long-conversation-typing: style recalc count 78
agent-composer-long-conversation-typing: task duration 1229ms
agent-composer-long-conversation-typing: script duration 381ms
agent-composer-long-conversation-typing: TBT 0ms
agent-composer-long-conversation-typing: heap used 103.6 MB
agent-composer-long-conversation-typing: DOM nodes 76
agent-composer-long-conversation-typing: event listeners 876
Raw data
{
  "timestamp": "2026-10-01T01:09:03.768Z",
  "gitSha": "c162688a112129aa2ad184804164dca5c550f66d",
  "branch": "jaewon/fe-3109-billing-web-telemetry-bootstrap-datadog-rum-and-posthog",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2041.2529999999833,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 5.129,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 481.579,
      "heapDeltaBytes": -10461088,
      "heapUsedBytes": 71884272,
      "domNodes": -232,
      "jsHeapTotalBytes": -786432,
      "scriptDurationMs": 11.735,
      "eventListeners": -164,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66585365853659,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "canvas-idle",
      "durationMs": 2020.3000000000202,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 3.2560000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 394.212,
      "heapDeltaBytes": 22339900,
      "heapUsedBytes": 75873724,
      "domNodes": -231,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 11.542,
      "eventListeners": -102,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66611570247934,
      "p95FrameDurationMs": 16.700000000000273
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1726.7009999999345,
      "styleRecalcs": 74,
      "styleRecalcDurationMs": 17.959999999999997,
      "layouts": 12,
      "layoutDurationMs": 4.024000000000001,
      "taskDurationMs": 759.456,
      "heapDeltaBytes": -12747052,
      "heapUsedBytes": 69450372,
      "domNodes": -232,
      "jsHeapTotalBytes": -262144,
      "scriptDurationMs": 134.31799999999998,
      "eventListeners": -164,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666346153846153,
      "p95FrameDurationMs": 16.799999999999727
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1693.948999999975,
      "styleRecalcs": 52,
      "styleRecalcDurationMs": 14.303999999999998,
      "layouts": 12,
      "layoutDurationMs": 3.9050000000000002,
      "taskDurationMs": 681.4060000000001,
      "heapDeltaBytes": 19201100,
      "heapUsedBytes": 72334180,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 129.05700000000002,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665686274509806,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1743.8949999999522,
      "styleRecalcs": 31,
      "styleRecalcDurationMs": 9.899,
      "layouts": 6,
      "layoutDurationMs": 1.0999999999999999,
      "taskDurationMs": 369.89099999999996,
      "heapDeltaBytes": -6531052,
      "heapUsedBytes": 75845164,
      "domNodes": -179,
      "jsHeapTotalBytes": -524288,
      "scriptDurationMs": 13.475999999999999,
      "eventListeners": -149,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66666666666666,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1708.1229999998868,
      "styleRecalcs": 31,
      "styleRecalcDurationMs": 10.621,
      "layouts": 6,
      "layoutDurationMs": 1.2409999999999997,
      "taskDurationMs": 313.629,
      "heapDeltaBytes": -1445404,
      "heapUsedBytes": 56103544,
      "domNodes": 53,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 13.719999999999995,
      "eventListeners": 15,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666019417475727,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 565.4139999999188,
      "styleRecalcs": 13,
      "styleRecalcDurationMs": 3.6270000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 394.91299999999995,
      "heapDeltaBytes": 13824044,
      "heapUsedBytes": 72509344,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 146.49499999999998,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66470588235295,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 577.0929999999908,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 3.177000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 389.49699999999996,
      "heapDeltaBytes": 13601744,
      "heapUsedBytes": 67289716,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 136.873,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66571428571429,
      "p95FrameDurationMs": 16.700000000000273
    },
    {
      "name": "dom-widget-order-dense-n200-w200-i120",
      "durationMs": 1031.1459999999215,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 693.995,
      "heapDeltaBytes": 9861476,
      "heapUsedBytes": 91316232,
      "domNodes": 0,
      "jsHeapTotalBytes": 7241728,
      "scriptDurationMs": 53.851,
      "eventListeners": 0,
      "totalBlockingTimeMs": 409,
      "frameDurationMs": 30.391176470588242,
      "p95FrameDurationMs": 16.700000000000273
    },
    {
      "name": "dom-widget-order-dense-n200-w200-i120",
      "durationMs": 1016.2860000000364,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 662.8760000000001,
      "heapDeltaBytes": 10369800,
      "heapUsedBytes": 87101164,
      "domNodes": 0,
      "jsHeapTotalBytes": 1736704,
      "scriptDurationMs": 54.568999999999996,
      "eventListeners": 0,
      "totalBlockingTimeMs": 390,
      "frameDurationMs": 29.9,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-order-sparse-n1000-w20-i120",
      "durationMs": 811.6999999999734,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 420.35,
      "heapDeltaBytes": 16618484,
      "heapUsedBytes": 115250376,
      "domNodes": 0,
      "jsHeapTotalBytes": 2363392,
      "scriptDurationMs": 130.456,
      "eventListeners": 0,
      "totalBlockingTimeMs": 169,
      "frameDurationMs": 23.33428571428571,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-order-sparse-n1000-w20-i120",
      "durationMs": 782.4669999999969,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 396.19700000000034,
      "heapDeltaBytes": 16294384,
      "heapUsedBytes": 100643176,
      "domNodes": 0,
      "jsHeapTotalBytes": 528384,
      "scriptDurationMs": 116.08000000000001,
      "eventListeners": 0,
      "totalBlockingTimeMs": 161,
      "frameDurationMs": 23.03823529411765,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "extension-clean-combined-draw",
      "durationMs": 8298.973000000045,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 7301.508,
      "heapDeltaBytes": 2169272,
      "heapUsedBytes": 82623504,
      "domNodes": 0,
      "jsHeapTotalBytes": -13369344,
      "scriptDurationMs": 5700.938000000001,
      "eventListeners": 0,
      "totalBlockingTimeMs": 54,
      "frameDurationMs": 25.644272445820434,
      "p95FrameDurationMs": 50
    },
    {
      "name": "extension-clean-combined-draw",
      "durationMs": 6946.66200000006,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 6225.757,
      "heapDeltaBytes": 14038952,
      "heapUsedBytes": 94171088,
      "domNodes": 0,
      "jsHeapTotalBytes": -5767168,
      "scriptDurationMs": 5066.3769999999995,
      "eventListeners": 0,
      "totalBlockingTimeMs": 39,
      "frameDurationMs": 25.67777777777778,
      "p95FrameDurationMs": 50
    },
    {
      "name": "extension-rgthree-prototype-draw",
      "durationMs": 7624.373999999989,
      "styleRecalcs": 2,
      "styleRecalcDurationMs": 0.7859999999999985,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 6712.907,
      "heapDeltaBytes": 28596828,
      "heapUsedBytes": 96361124,
      "domNodes": -142,
      "jsHeapTotalBytes": -6164480,
      "scriptDurationMs": 5245.167,
      "eventListeners": -74,
      "totalBlockingTimeMs": 91,
      "frameDurationMs": 24.490032154340838,
      "p95FrameDurationMs": 33.400000000001455
    },
    {
      "name": "extension-rgthree-prototype-draw",
      "durationMs": 7602.206000000024,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 6739.602000000001,
      "heapDeltaBytes": 11452828,
      "heapUsedBytes": 91998652,
      "domNodes": 0,
      "jsHeapTotalBytes": -11010048,
      "scriptDurationMs": 5301.056,
      "eventListeners": 0,
      "totalBlockingTimeMs": 35,
      "frameDurationMs": 24.436334405144695,
      "p95FrameDurationMs": 33.400000000000546
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2041.360999999938,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 3.591000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 611.809,
      "heapDeltaBytes": -12940016,
      "heapUsedBytes": 82640072,
      "domNodes": -328,
      "jsHeapTotalBytes": -135168,
      "scriptDurationMs": 33.74000000000001,
      "eventListeners": -164,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666393442622947,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2032.3880000000827,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 6.176999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 548.1499999999999,
      "heapDeltaBytes": -20268784,
      "heapUsedBytes": 82050160,
      "domNodes": -328,
      "jsHeapTotalBytes": -1933312,
      "scriptDurationMs": 34.373,
      "eventListeners": -142,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66639344262295,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2134.3479999999317,
      "styleRecalcs": 67,
      "styleRecalcDurationMs": 10.305000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1373.7250000000001,
      "heapDeltaBytes": 19692704,
      "heapUsedBytes": 82429512,
      "domNodes": -328,
      "jsHeapTotalBytes": 1798144,
      "scriptDurationMs": 646.383,
      "eventListeners": -160,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666141732283464,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2154.404999999997,
      "styleRecalcs": 70,
      "styleRecalcDurationMs": 11.468999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1393.475,
      "heapDeltaBytes": -3720088,
      "heapUsedBytes": 69672616,
      "domNodes": 0,
      "jsHeapTotalBytes": 524288,
      "scriptDurationMs": 683.6999999999999,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665891472868218,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3252.061000000026,
      "styleRecalcs": 63,
      "styleRecalcDurationMs": 12.081000000000001,
      "layouts": 60,
      "layoutDurationMs": 14.553,
      "taskDurationMs": 1456.6760000000002,
      "heapDeltaBytes": 8578680,
      "heapUsedBytes": 73063896,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 639.0819999999999,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666153846153847,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3271.2490000001253,
      "styleRecalcs": 63,
      "styleRecalcDurationMs": 11.572,
      "layouts": 60,
      "layoutDurationMs": 14.278,
      "taskDurationMs": 1472.16,
      "heapDeltaBytes": 8257616,
      "heapUsedBytes": 72559500,
      "domNodes": -328,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 646.533,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665816326530614,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 2433.520999999928,
      "styleRecalcs": 44,
      "styleRecalcDurationMs": 6.206000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1595.3390000000002,
      "heapDeltaBytes": 17258372,
      "heapUsedBytes": 81987252,
      "domNodes": 0,
      "jsHeapTotalBytes": 417792,
      "scriptDurationMs": 780.785,
      "eventListeners": 180,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.78137931034482,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 2517.8750000000036,
      "styleRecalcs": 44,
      "styleRecalcDurationMs": 6.526999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1669.9609999999998,
      "heapDeltaBytes": 17271724,
      "heapUsedBytes": 82206520,
      "domNodes": 0,
      "jsHeapTotalBytes": 679936,
      "scriptDurationMs": 796.311,
      "eventListeners": 180,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.777852348993285,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 2027.8650000000198,
      "styleRecalcs": 5,
      "styleRecalcDurationMs": 1.8319999999999967,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 531.4040000000001,
      "heapDeltaBytes": 20989908,
      "heapUsedBytes": 83900824,
      "domNodes": -328,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 31.169000000000004,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666115702479335,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 2004.8199999998815,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 3.4240000000000017,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 373.919,
      "heapDeltaBytes": -1801940,
      "heapUsedBytes": 76674076,
      "domNodes": 0,
      "jsHeapTotalBytes": 36864,
      "scriptDurationMs": 32.09799999999999,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665289256198346,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 569.1989999999123,
      "styleRecalcs": 48,
      "styleRecalcDurationMs": 6.197999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 371.325,
      "heapDeltaBytes": -20127740,
      "heapUsedBytes": 62572392,
      "domNodes": -250,
      "jsHeapTotalBytes": -262144,
      "scriptDurationMs": 123.36100000000002,
      "eventListeners": -204,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.667647058823523,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 533.5150000000795,
      "styleRecalcs": 48,
      "styleRecalcDurationMs": 6.038,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 341.39799999999997,
      "heapDeltaBytes": 10180344,
      "heapUsedBytes": 70402116,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 121.793,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66250000000001,
      "p95FrameDurationMs": 16.700000000000273
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2027.5229999999738,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 3.955,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 456.916,
      "heapDeltaBytes": -7658812,
      "heapUsedBytes": 75328840,
      "domNodes": -250,
      "jsHeapTotalBytes": -262144,
      "scriptDurationMs": 10.736,
      "eventListeners": -210,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666393442622947,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2013.9149999999972,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 6.312000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 387.80099999999993,
      "heapDeltaBytes": 22322100,
      "heapUsedBytes": 75630496,
      "domNodes": -250,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 10.126999999999999,
      "eventListeners": -210,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666115702479342,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1688.5350000000017,
      "styleRecalcs": 76,
      "styleRecalcDurationMs": 17.096,
      "layouts": 16,
      "layoutDurationMs": 5.337,
      "taskDurationMs": 652.3259999999999,
      "heapDeltaBytes": 14928160,
      "heapUsedBytes": 67976704,
      "domNodes": -250,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 95.189,
      "eventListeners": -210,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665346534653462,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1721.5229999999337,
      "styleRecalcs": 57,
      "styleRecalcDurationMs": 17.037,
      "layouts": 16,
      "layoutDurationMs": 5.82,
      "taskDurationMs": 680.196,
      "heapDeltaBytes": 15318580,
      "heapUsedBytes": 68712132,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 102.872,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.82941176470588,
      "p95FrameDurationMs": 16.799999999999727
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 1033.7190000000192,
      "styleRecalcs": 17,
      "styleRecalcDurationMs": 24.291000000000007,
      "layouts": 5,
      "layoutDurationMs": 9.904,
      "taskDurationMs": 741.828,
      "heapDeltaBytes": 22023336,
      "heapUsedBytes": 106301068,
      "domNodes": 13747,
      "jsHeapTotalBytes": 8650752,
      "scriptDurationMs": 23.492000000000004,
      "eventListeners": 2383,
      "totalBlockingTimeMs": 91,
      "frameDurationMs": 19.496226415094345,
      "p95FrameDurationMs": 33.399999999999636
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8159.524000000033,
      "styleRecalcs": 250,
      "styleRecalcDurationMs": 36.324999999999996,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 4758.809,
      "heapDeltaBytes": 16730796,
      "heapUsedBytes": 78760260,
      "domNodes": -328,
      "jsHeapTotalBytes": 1536000,
      "scriptDurationMs": 2168.327,
      "eventListeners": -142,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666053169734152,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8200.454000000036,
      "styleRecalcs": 250,
      "styleRecalcDurationMs": 36.452999999999996,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 4986.086,
      "heapDeltaBytes": -12734080,
      "heapUsedBytes": 82892832,
      "domNodes": -328,
      "jsHeapTotalBytes": 1138688,
      "scriptDurationMs": 2233.612,
      "eventListeners": -142,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666056910569107,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 14949.761999999964,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 14501.114,
      "heapDeltaBytes": -16938376,
      "heapUsedBytes": 196449536,
      "domNodes": -3045,
      "jsHeapTotalBytes": 6692864,
      "scriptDurationMs": 222.526,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 26.743112701252237,
      "p95FrameDurationMs": 50
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 15079.0149999998,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 14592.035999999998,
      "heapDeltaBytes": -33241860,
      "heapUsedBytes": 182521752,
      "domNodes": -3046,
      "jsHeapTotalBytes": 7163904,
      "scriptDurationMs": 242.68,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 26.76021314387211,
      "p95FrameDurationMs": 50
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 17649.79600000004,
      "styleRecalcs": 138,
      "styleRecalcDurationMs": 18.814999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 17368.506,
      "heapDeltaBytes": -11748520,
      "heapUsedBytes": 190949596,
      "domNodes": -3045,
      "jsHeapTotalBytes": 8339456,
      "scriptDurationMs": 755.342,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 4,
      "frameDurationMs": 33.81091954022988,
      "p95FrameDurationMs": 66.70000000000073
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 17916.953000000147,
      "styleRecalcs": 134,
      "styleRecalcDurationMs": 18.471999999999987,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 17662.01,
      "heapDeltaBytes": -18672500,
      "heapUsedBytes": 181391592,
      "domNodes": -3045,
      "jsHeapTotalBytes": 8716288,
      "scriptDurationMs": 870.6400000000001,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 7,
      "frameDurationMs": 34.32183908045977,
      "p95FrameDurationMs": 66.70000000000073
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 5408.548999999994,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 63.12100000000001,
      "layouts": 20,
      "layoutDurationMs": 23.927000000000003,
      "taskDurationMs": 5342.286999999999,
      "heapDeltaBytes": 738720,
      "heapUsedBytes": 221076640,
      "domNodes": 0,
      "jsHeapTotalBytes": 524288,
      "scriptDurationMs": 94.045,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 33.853125,
      "p95FrameDurationMs": 66.70000000000073
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 5492.005999999947,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 62.43900000000002,
      "layouts": 20,
      "layoutDurationMs": 23.232000000000003,
      "taskDurationMs": 5358.58,
      "heapDeltaBytes": 825340,
      "heapUsedBytes": 203308724,
      "domNodes": 0,
      "jsHeapTotalBytes": 1048576,
      "scriptDurationMs": 90.78500000000001,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 31.512643678160924,
      "p95FrameDurationMs": 66.70000000000073
    },
    {
      "name": "vue-zoom-out-idle",
      "durationMs": 7550.2669999999625,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 7359.783,
      "heapDeltaBytes": -24777392,
      "heapUsedBytes": 198130016,
      "domNodes": -3045,
      "jsHeapTotalBytes": 7602176,
      "scriptDurationMs": 115.76999999999998,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 26.583450704225356,
      "p95FrameDurationMs": 50
    },
    {
      "name": "vue-zoom-out-idle",
      "durationMs": 7569.023000000016,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 7428.107000000001,
      "heapDeltaBytes": -42070004,
      "heapUsedBytes": 189979288,
      "domNodes": -3045,
      "jsHeapTotalBytes": 4718592,
      "scriptDurationMs": 112.80799999999996,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 27.961851851851847,
      "p95FrameDurationMs": 50
    },
    {
      "name": "workflow-execution",
      "durationMs": 535.1170000000138,
      "styleRecalcs": 22,
      "styleRecalcDurationMs": 22.25,
      "layouts": 5,
      "layoutDurationMs": 2.61,
      "taskDurationMs": 197.25099999999998,
      "heapDeltaBytes": -42600112,
      "heapUsedBytes": 56452808,
      "domNodes": -100,
      "jsHeapTotalBytes": 4718592,
      "scriptDurationMs": 19.000999999999998,
      "eventListeners": -82,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 18.389655172413782,
      "p95FrameDurationMs": 33.30000000000018
    },
    {
      "name": "workflow-execution",
      "durationMs": 94.23599999990984,
      "styleRecalcs": 6,
      "styleRecalcDurationMs": 9.65,
      "layouts": 2,
      "layoutDurationMs": 1.0019999999999998,
      "taskDurationMs": 65.87499999999999,
      "heapDeltaBytes": 3743204,
      "heapUsedBytes": 57140472,
      "domNodes": 113,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 5.146,
      "eventListeners": 17,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000273
    },
    {
      "name": "agent-composer-empty-conversation-typing",
      "durationMs": 648.7130000000434,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 92.98299999999999,
      "layouts": 76,
      "layoutDurationMs": 23.535,
      "taskDurationMs": 616.273,
      "heapDeltaBytes": 15358464,
      "heapUsedBytes": 81575928,
      "domNodes": 76,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 226.919,
      "eventListeners": 876,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66500000000001,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "agent-composer-empty-conversation-typing",
      "durationMs": 583.9539999999488,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 85.426,
      "layouts": 76,
      "layoutDurationMs": 21.709,
      "taskDurationMs": 554.489,
      "heapDeltaBytes": 14577868,
      "heapUsedBytes": 80476460,
      "domNodes": 76,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 203.731,
      "eventListeners": 876,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "agent-composer-long-conversation-typing",
      "durationMs": 1206.3399999999547,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 256.05899999999997,
      "layouts": 76,
      "layoutDurationMs": 26.346,
      "taskDurationMs": 1179.778,
      "heapDeltaBytes": -20232264,
      "heapUsedBytes": 108115996,
      "domNodes": 76,
      "jsHeapTotalBytes": 524288,
      "scriptDurationMs": 361.19800000000004,
      "eventListeners": 876,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "agent-composer-long-conversation-typing",
      "durationMs": 1296.0259999999835,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 260.19599999999997,
      "layouts": 76,
      "layoutDurationMs": 28.101999999999997,
      "taskDurationMs": 1277.364,
      "heapDeltaBytes": -19198424,
      "heapUsedBytes": 109120264,
      "domNodes": 76,
      "jsHeapTotalBytes": 524288,
      "scriptDurationMs": 401.77399999999994,
      "eventListeners": 876,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66538461538462,
      "p95FrameDurationMs": 16.799999999999272
    }
  ]
}

🔬 E2E Coverage

Metric Covered Total Pct
Lines 53228 81575 65.3% 🟡
Functions 0 0 — —
Branches 0 0 — —
Top 10 files by uncovered lines
File Coverage Missed
src/LGraphCanvas.ts 67.3% 1155
src/LGraphNode.ts 70.3% 388
src/platform/workspace/stores/billingOperationStore.ts 7.8% 367
src/renderer/extensions/layerEditor/composables/useLayerEditorSession.ts 40.1% 332
src/LGraph.ts 79.2% 267
src/core/billing/operationLifecycle.ts 1.1% 260
src/platform/workspace/stores/teamWorkspaceStore.ts 39.2% 258
src/scripts/app.ts 73.3% 251
src/core/webSessionIdentity.ts 3.4% 224
src/scripts/pnginfo.ts 20.7% 222

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.95238% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/shared-frontend-utils/src/piiUtil.ts 0.00% 10 Missing ⚠️
apps/billing-web/src/config/firebase.ts 0.00% 1 Missing ⚠️
...s/billing-web/src/telemetry/billingWebTelemetry.ts 97.82% 0 Missing and 1 partial ⚠️
@@                                 Coverage Diff                                  @@
##           jaewon/fe-3109-billing-web-datadog-rum-bootstrap   #19689      +/-   ##
====================================================================================
+ Coverage                                             84.50%   84.52%   +0.02%     
====================================================================================
  Files                                                  3366     3367       +1     
  Lines                                                162280   162042     -238     
  Branches                                              42486    42196     -290     
====================================================================================
- Hits                                                 137137   136970     -167     
+ Misses                                                23221    23149      -72     
- Partials                                               1922     1923       +1     
Flag Coverage Δ
billing-web-unit 92.16% <95.83%> (+0.07%) ⬆️
e2e 65.24% <ø> (-0.02%) ⬇️
unit 81.83% <33.33%> (+0.01%) ⬆️
website-unit 79.68% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
apps/billing-web/src/telemetry/rum.ts 93.75% <100.00%> (+0.20%) ⬆️
packages/account-core/src/firebase/configSource.ts 100.00% <100.00%> (ø)
packages/account-core/src/firebase/index.ts 94.87% <100.00%> (+0.08%) ⬆️
...emetry/providers/cloud/PostHogTelemetryProvider.ts 73.14% <100.00%> (ø)
apps/billing-web/src/config/firebase.ts 75.00% <0.00%> (-25.00%) ⬇️
...s/billing-web/src/telemetry/billingWebTelemetry.ts 97.82% <97.82%> (ø)
packages/shared-frontend-utils/src/piiUtil.ts 50.00% <0.00%> (-50.00%) ⬇️

... and 58 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Oct 1, 2026
@dante01yoon
dante01yoon merged commit 58b4386 into jaewon/fe-3109-billing-web-datadog-rum-bootstrap Oct 1, 2026
133 checks passed
@dante01yoon
dante01yoon deleted the jaewon/fe-3109-billing-web-telemetry-bootstrap-datadog-rum-and-posthog branch October 1, 2026 13:13
another-chi pushed a commit to another-chi/ComfyUI_frontend that referenced this pull request Oct 1, 2026
## Summary

Billing web telemetry bootstrap, in two halves reviewed together:
initialize Datadog RUM in billing web with the cloud app's RUM
application under the service `comfy-billing-web` (origin-side scrub,
error reporter, action helper), and initialize PostHog with the cloud
app's configuration plus the billing event facade that later tickets
call to send `billing.<operation>.<stage>` events to RUM and PostHog,
stamped `billing_surface: 'billing_web'`. No business events are emitted
here.

## Why

Billing web emits nothing today: no RUM, so its errors and billing
actions are invisible. Every later billing web event (attempt lifecycle,
journey, entry, portal) needs a place to go, and rollout tracking has to
see billing web next to the cloud app in the same Datadog application.
Rollout analytics live in PostHog (decision D11), and a billing web
event is only useful if it reaches PostHog next to the cloud app's
events and joins the same person; billing web had no PostHog and no
single place to send billing events from.

## How

**Part 1, Datadog RUM**

- **Init.** `initBillingWebRum` uses the cloud app's RUM application
(same application id and public client token, now exported from
`@comfyorg/shared-frontend-utils/telemetry`), `service:
'comfy-billing-web'`, session replay off, trace propagation off. Env
comes from the existing billing host map (`billing.comfy.org` to
`prod-v2`, `stagingbilling.comfy.org` to `stg-v2`,
`testbilling.comfy.org` to `test-v2`); any other host (previews, local)
sends nothing. The version is the commit, set at build time.
- **Scrub before send.** Query strings are stripped from view, referrer
and resource URLs (a Stripe return carries a client secret there).
Emails, tokens and similar text are redacted from error messages, stacks
and action names. An error whose cause carries sensitive text is
dropped, because RUM ignores `beforeSend` writes to causes. Third-party
noise is filtered with the same rules as the cloud app.
- **Helpers.** `reportBillingWebError` (never throws, tags
`billing_surface: 'billing_web'`) and `addRumAction` (no-op when RUM is
not initialized).
- **Shared module.** The RUM application constants, the noise filter,
the console-echo prefix and the deploy env type moved into
`@comfyorg/shared-frontend-utils/telemetry`. The cloud app imports them
from there with no behavior change.
- **CSP.** The report-only policy of billing web gains the RUM intake
host in `connect-src`.

**Part 2, PostHog and the billing event facade**

- **Config.** PostHog's token, host and the `telemetry_disabled_events`
opt-out are read from the same cloud-origin `/api/features` fetch
billing web already makes for Firebase (parsed once in `account-core`),
so the cloud app stays the single source of truth. When no token is
returned, PostHog stays off.
- **Lazy load.** `posthog-js` loads in a separate chunk, so the
first-load bundle is unaffected. Events sent while it loads wait in a
bounded queue (50) and are flushed, or dropped if PostHog turns out to
be off.
- **Privacy.** Same sanitizer as the cloud app, plus: session recording,
performance and web-vitals capture, heatmaps, dead clicks, exception
capture and external script loading are off; `promo` and the Stripe
return parameters are masked wherever PostHog stores a URL, its
cross-subdomain cookie included; `person_profiles` is `identified_only`.
- **Identity.** The cookie is shared across `*.comfy.org`, so it may
already name someone. Billing web identifies with the user id once a
session exists, resets if the cookie names a different identified user,
and resets on sign-out only for a user it identified itself, so a
visitor never signed in here keeps the cloud identity. A refused or
still-resolving session says nothing about who is signed in.
- **Facade.** `billingWebTelemetry.trackBillingEvent(name, payload)`
sends one event to RUM (as an action) and PostHog, stamps
`billing_surface: 'billing_web'`, never throws into the billing flow,
and does nothing when telemetry is off. It takes the cloud contract's
allowlisted payload as input.
- **Shared.** The PostHog base options and default host moved into
`@comfyorg/shared-frontend-utils/telemetry`; the cloud provider imports
them with no behavior change.

## Review Focus

- Two halves in one PR. The PostHog half was opened as Comfy-Org#19689, stacked
on this PR, and merged into this branch before the RUM half merged, so
this PR now carries both. Christian's earlier approval covered the RUM
half at `272b392bbb`; the PostHog half is `272b392bbb..58b4386` (the
diff of Comfy-Org#19689) plus the review fixes after it.
- Size: about 600 added non-test lines in total (RUM about 281, PostHog
and facade about 315), so review the two halves separately.
- Fixes after the PostHog half merged in, from CodeRabbit: `1d36c66005`
redacts URL queries in linear time (the old pattern was quadratic on
query-free input, `"https://".repeat(60_000)` took about 17 s), and
`351c2917b3` makes `reportBillingWebError` log only the redacted message
instead of the raw cause. The CSP finding got no change: the policy is
report-only and all three cloud origins return `https://t.comfy.org`,
which is already in `connect-src`.
- Cloud app files changed only to import from the shared module:
`datadogRumBeforeSend.ts`, `initDatadogRum.ts`, `reportError.ts`,
`thirdPartyErrorNoise.ts`. The application id, client token, site and
noise rules are the same values and logic as before; the cloud suites
pass unchanged.
- No secrets: the RUM client token and application id are the public
values already shipped in the cloud app's source.
- Billing web scrubs more than the cloud app does. The cloud app's RUM
`beforeSend` does not strip URLs, emails or tokens, and cloud RUM also
records the user's email. That is existing behavior, not changed here;
moving the cloud onto the shared scrub is tracked in
[FE-3141](https://linear.app/comfyorg/issue/FE-3141).
- Only the three billing hosts report; previews and local builds send
nothing, so they cannot pollute a deployed environment.
- One line-scoped `eslint-disable-next-line no-restricted-imports` in
`rum.ts`, for the same reason `src/platform/telemetry` has one: this
module is billing web's telemetry layer and owns the RUM sink.
- Loading RUM at startup adds about 62 kB gzip to billing web's
first-load bundle. The RUM user id is deliberately not set; the cloud
app sets both id and email, and whether billing web should set an opaque
id is a separate decision.
- `person_profiles`: the cloud's server-side PostHog config sets
`person_profiles: 'always'`, so production cloud does not run the
`identified_only` our constraints say it does. Billing web ignores that
override and stays `identified_only`. The cloud difference is not
changed here.
- The typed event contract is not shared yet:
`src/platform/telemetry/types.ts` imports cloud-only types, so billing
web cannot import it, and moving it would edit the allowlist that Comfy-Org#19685
is changing. The facade therefore takes the contract's output (event
name and allowlisted payload). The contract move should land after
Comfy-Org#19685 and before FE-3117; it is tracked in
[FE-3140](https://linear.app/comfyorg/issue/FE-3140).
- Cloud PostHog pageviews carry full URLs and cloud RUM records the
user's email. Billing web does neither. Moving the cloud onto the shared
scrub is tracked in
[FE-3141](https://linear.app/comfyorg/issue/FE-3141).
- No deployment configuration is needed: all three cloud origins already
return the PostHog token and host, and none returns
`telemetry_disabled_events`. `FRONTEND_COMMIT_HASH` is an optional
override for the version.
- `UnifiedPricingTable.test.ts` ("prompts free-tier users to subscribe")
fails locally on `origin/main` too (`INTERNAL ASSERTION FAILED: Expected
a class definition`, local Node 24 against engine 26). This diff does
not touch it.

## AS IS / TO BE

**Part 1, RUM**

AS IS: ![AS IS at 0bd3442: 8 of 10 scenarios off contract.
datadogRum.init is never called on billing.comfy.org,
stagingbilling.comfy.org or testbilling.comfy.org, and beforeSend sends
the Stripe client secret, emails in an error message, an action name and
an error cause, and LinkedIn pixel noise unchanged; 15 of 21 rum.test.ts
tests
fail](https://github.com/user-attachments/assets/33609cd7-b712-4351-9a2e-044b4550c6e7)

TO BE: ![TO BE at 272b392: 10 of 10 scenarios on contract. The three
billing hosts init RUM as comfy-billing-web in prod-v2, stg-v2 and
test-v2 with version set, trace propagation off and session replay 0,
localhost and the Vercel preview init nothing, and beforeSend strips the
query, redacts emails, drops the sensitive cause and the third-party
noise; rum.test.ts 25 of 25 and telemetry.test.ts 15 of 15
pass](https://github.com/user-attachments/assets/c8585739-1e0c-4ad7-ab84-7e58229bb73b)

**Part 2, PostHog and facade**

AS IS: ![AS IS at 84734e2: the stub sends nothing.
trackBillingEvent(billing.subscription_checkout.started) makes 0 PostHog
captures and 0 RUM actions, nothing is queued or flushed, posthog.init
and identify/reset are never called, before_send never runs, and
resolveCloudTelemetryConfig returns no PostHog fields; 16 of 129 tests
in the three touched files
fail](https://github.com/user-attachments/assets/66cbb345-ad9a-493c-befe-296d687cf4b1)

TO BE: ![TO BE at 2b0c877: billing.subscription_checkout.started
reaches PostHog and RUM stamped billing_surface billing_web; an event
tracked while PostHog loads is held then flushed; with no token PostHog
never initializes; a disabled event is held back from PostHog only; a
different cookie user is reset before identify, sign-out resets only a
user identified here; init turns off recording, performance, heatmaps,
dead clicks, exceptions and external scripts, masks promo and Stripe
params, uses person_profiles identified_only; 129 of 129 tests
pass](https://github.com/user-attachments/assets/e671136e-772b-4be2-a819-c7fc591a9db9)

The evidence has two parts. Part 1, RUM: what the billing web RUM
configuration is and what its `beforeSend` does to representative events
(a Stripe return URL, an error with an email, a noisy third-party
error), before (nothing initialized) and after. Part 2, PostHog: what
billing web sends to PostHog and RUM for a representative billing event,
a Stripe return URL and a sign-in/sign-out sequence, before (nothing
sent) and after.

## Where this sits in the plan

Linear: [FE-3109](https://linear.app/comfyorg/issue/FE-3109), part of
[FE-3105](https://linear.app/comfyorg/issue/FE-3105/billing-web-and-sdk-rollout-telemetry-events-fixes-and-dashboards).
Plan, event catalog and dependency graph: [action
items](https://app.notion.com/p/3ea6d73d3650814ba248d4d1431b8a89).

| Task | Ticket | What | Status |
| --- | --- | --- | --- |
| T1 | FE-3107 | Decide vocabulary and dimensions | decided, SSOT page
pending |
| T2 | FE-3108 | Decide RUM application and env mapping | decided |
| T3 | FE-3109 | Billing web telemetry bootstrap (RUM and PostHog) |
this PR |
| T4, F1 | FE-3106 | SDK-rail ownership | [PR
19620](Comfy-Org#19620), merged
|
| T4, F2 | FE-3110 | Keep operation id and fields in the mapper | [PR
19623](Comfy-Org#19623), merged
|
| T4, F3 | FE-3111 | Stamp billing_surface and billing_client | [PR
19685](Comfy-Org#19685), in
review |
| T4, F5 | FE-3112 | SDK top-up terminals | [PR
19628](Comfy-Org#19628), merged
|
| T4, F6 | FE-3113 | Downgrade reconciliation terminal | [PR
19622](Comfy-Org#19622), merged
|
| T4, F7 | FE-3114 | Legacy personal-rail events, first slice | [PR
19627](Comfy-Org#19627), merged
|
| T4, F7+ | FE-3131 | Legacy personal-rail events, remaining slices |
[PR 19686](Comfy-Org#19686),
merged |
| T5 | FE-3115 | Cloud entry fidelity and Datadog parity | todo |
| T6 | FE-3116 | Handoff contract and event | [PR
19687](Comfy-Org#19687), in
review |
| T7 | FE-3117 | Billing web attempt lifecycle | todo |
| T8 | FE-3118 | Billing web journey and choices | todo |
| T9 | FE-3119 | Payment friction events | todo |
| T10 | FE-3120 | Billing web entry, session and return | todo |
| T11 | FE-3121 | Portal events | todo |
| T12 | FE-3122 | Flag coverage check | todo |
| T13 | FE-3123 | PostHog rollout dashboard | todo |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | todo |
| T15 | FE-3125 | Verification per flow | todo |
| T16 | FE-3126 | Rollout plan | todo |

```mermaid
flowchart LR
  subgraph DEC["Decided"]
    T1["FE-3107 T1 vocabulary"]
    T2["FE-3108 T2 RUM app and env"]
  end
  subgraph FIX["Existing events (T4)"]
    F1["FE-3106 F1 SDK-rail ownership"]
    F2["FE-3110 F2 mapper fields"]
    F3["FE-3111 F3 surface and client"]
    F5["FE-3112 F5 top-up terminals"]
    F6["FE-3113 F6 downgrade terminal"]
    F7["FE-3114 F7 legacy personal, first slice"]
    F7B["FE-3131 F7 remaining slices"]
  end
  subgraph EMIT["New events"]
    T3["FE-3109 T3 billing web bootstrap"]
    T5["FE-3115 T5 cloud entry and parity"]
    T6["FE-3116 T6 handoff contract"]
    T7["FE-3117 T7 attempt lifecycle"]
    T8["FE-3118 T8 journey and choices"]
    T9["FE-3119 T9 friction"]
    T10["FE-3120 T10 entry, session, return"]
    T11["FE-3121 T11 portal"]
    T12["FE-3122 T12 flag coverage"]
  end
  subgraph DASH["Dashboards"]
    T13["FE-3123 T13 PostHog rollout"]
    T14["FE-3124 T14 Frontend RUM tiles"]
  end
  T15["FE-3125 T15 verification"]
  T16["FE-3126 T16 rollout plan"]
  T2 --> T3
  T1 --> F3
  T1 --> T5
  T1 --> T6
  T1 --> T13
  T1 --> T14
  T2 --> T14
  F2 --> T7
  T3 --> T7
  T3 --> T8
  T3 --> T10
  T3 --> T11
  T3 --> T12
  T5 --> T11
  T6 --> T8
  T6 --> T10
  T7 --> T9
  T8 --> T9
  F1 --> T13
  F3 --> T13
  FIX --> T15
  T5 --> T15
  T9 --> T15
  T10 --> T15
  T11 --> T15
  T12 --> T15
  T13 --> T15
  T14 --> T15
  T13 --> T16
  T15 --> T16
  style T3 stroke-width:3px
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:xhigh PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants