Skip to content

✨ add UNSTABLE_useVueComponentTracker composable#4330

Draft
mormubis wants to merge 2 commits intoadlrb/vue-routerfrom
adlrb/vue-tracker
Draft

✨ add UNSTABLE_useVueComponentTracker composable#4330
mormubis wants to merge 2 commits intoadlrb/vue-routerfrom
adlrb/vue-tracker

Conversation

@mormubis
Copy link
Contributor

Motivation

Fourth of five PRs (#4325, #4327, #4328 are the first three). Adds component-level performance tracking.

Changes

`UNSTABLE_useVueComponentTracker('MyComponent')` called inside `setup()` measures how long a component takes to mount and update using Vue's lifecycle hooks, reporting `vueComponentRender` duration vitals with `{ is_first_render: boolean, framework: 'vue' }`. Same vital name as `rum-react`'s `reactComponentRender` so cross-framework dashboards just work. Marked `UNSTABLE_` to match the React counterpart.

Test instructions

```bash
yarn test:unit --spec packages/rum-vue/src/domain/performance/useVueComponentTracker.spec.ts
```

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change
  • Added e2e/integration tests
  • Updated documentation (will come once the API is settled)

@datadog-prod-us1-6
Copy link

datadog-prod-us1-6 bot commented Mar 13, 2026

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 2 Tests failed

UNSTABLE_useVueComponentTracker reports a vueComponentRender vital on mount from Chrome 63.0.3239.84 (Windows 10) (Datadog) (Fix with Cursor)
TypeError: Object.fromEntries is not a function
    at getComponentsFromStubs (webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.esm-bundler.mjs:290:1 <- /tmp/_karma_webpack_500976/commons.js:140285:19)
    at createInstance (webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.esm-bundler.mjs:8305:1 <- /tmp/_karma_webpack_500976/commons.js:148300:24)
    at mount (webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.esm-bundler.mjs:8365:1 <- /tmp/_karma_webpack_500976/commons.js:148360:14)
    at UserContext.it (webpack:///packages/rum-vue/src/domain/performance/useVueComponentTracker.spec.ts:27:16 <- /tmp/_karma_webpack_500976/commons.js:113282:69)
    at <Jasmine>
UNSTABLE_useVueComponentTracker reports is_first_render: false on update from Chrome 63.0.3239.84 (Windows 10) (Datadog) (Fix with Cursor)
TypeError: Object.fromEntries is not a function
    at getComponentsFromStubs (webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.esm-bundler.mjs:290:1 <- /tmp/_karma_webpack_500976/commons.js:140285:19)
    at createInstance (webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.esm-bundler.mjs:8305:1 <- /tmp/_karma_webpack_500976/commons.js:148300:24)
    at mount (webpack:///node_modules/@vue/test-utils/dist/vue-test-utils.esm-bundler.mjs:8365:1 <- /tmp/_karma_webpack_500976/commons.js:148360:14)
    at UserContext.it (webpack:///packages/rum-vue/src/domain/performance/useVueComponentTracker.spec.ts:58:32 <- /tmp/_karma_webpack_500976/commons.js:113309:85)
    at <Jasmine>

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 88.24%
Overall Coverage: 77.30% (+0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: db60fb6 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@cit-pr-commenter-54b7da
Copy link

cit-pr-commenter-54b7da bot commented Mar 16, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 175.02 KiB 175.02 KiB 0 B 0.00%
Rum Profiler 6.16 KiB 6.16 KiB 0 B 0.00%
Rum Recorder 27.46 KiB 27.46 KiB 0 B 0.00%
Logs 56.80 KiB 56.80 KiB 0 B 0.00%
Rum Slim 130.66 KiB 130.66 KiB 0 B 0.00%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0041 0.0042 +2.44%
RUM - add action 0.0153 0.0138 -9.80%
RUM - add error 0.0129 0.0136 +5.43%
RUM - add timing 0.0028 0.0029 +3.57%
RUM - start view 0.0121 0.0128 +5.79%
RUM - start/stop session replay recording 0.0007 0.0008 +14.29%
Logs - log message 0.016 0.0169 +5.62%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 26.02 KiB 26.71 KiB +705 B
RUM - add action 51.99 KiB 51.49 KiB -513 B
RUM - add timing 26.92 KiB 26.85 KiB -72 B
RUM - add error 55.48 KiB 54.98 KiB -515 B
RUM - start/stop session replay recording 26.04 KiB 26.03 KiB -13 B
RUM - start view 466.71 KiB 465.58 KiB -1.13 KiB
Logs - log message 43.94 KiB 44.51 KiB +577 B

🔗 RealWorld

@mormubis mormubis force-pushed the adlrb/vue-tracker branch from ca26d99 to db60fb6 Compare March 18, 2026 16:13
@mormubis mormubis force-pushed the adlrb/vue-router branch 2 times, most recently from aaa50ac to 90c0728 Compare March 20, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant