Skip to content

⚗️ Add Nuxt plugin with router tracking#4424

Open
BeltranBulbarellaDD wants to merge 12 commits intomainfrom
beltran.bulbarella/nuxt_router
Open

⚗️ Add Nuxt plugin with router tracking#4424
BeltranBulbarellaDD wants to merge 12 commits intomainfrom
beltran.bulbarella/nuxt_router

Conversation

@BeltranBulbarellaDD
Copy link
Copy Markdown
Contributor

@BeltranBulbarellaDD BeltranBulbarellaDD commented Mar 31, 2026

Motivation

Add a first-party Nuxt integration for Browser RUM so Nuxt applications can plug into Datadog RUM with Nuxt-aware view tracking. This also gives us stable view names for Nuxt router templates instead of grouping views by concrete URLs.

Changes

  • Add a new @datadog/browser-rum-nuxt package with a nuxtRumPlugin(router) helper.
  • Configure the plugin to use manual view tracking and start RUM views from Nuxt router navigations.
  • Normalize Nuxt dynamic and catch-all routes into stable view names such as /user/[id] and /guides/[...slug].
  • Avoid creating extra views for failed navigations or same-path navigations that only change query params or hashes.
  • Add unit coverage for the Nuxt plugin and router view-name/tracking behavior.
  • Add a dedicated Nuxt test app plus Playwright coverage, and wire the Nuxt app into the E2E/build harness

Test instructions

  • yarn test:unit --spec packages/rum-nuxt/src/domain/nuxtPlugin.spec.ts
  • yarn test:unit --spec packages/rum-nuxt/src/domain/router/nuxtRouter.spec.ts
  • yarn build:apps --app nuxt-app
  • yarn test:e2e -g "nuxt - router"

Also can go into the nuxt test app package and use the developer extension to see events manually.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

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

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 178.55 KiB 178.55 KiB 0 B 0.00%
Rum Profiler 6.16 KiB 6.16 KiB 0 B 0.00%
Rum Recorder 26.97 KiB 26.97 KiB 0 B 0.00%
Logs 57.00 KiB 57.00 KiB 0 B 0.00%
Rum Slim 134.31 KiB 134.31 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.0076 0.0071 -6.58%
RUM - add action 0.0268 0.0224 -16.42%
RUM - add error 0.0243 0.0209 -13.99%
RUM - add timing 0.0049 0.0046 -6.12%
RUM - start view 0.0222 0.0213 -4.05%
RUM - start/stop session replay recording 0.0011 0.0012 +9.09%
Logs - log message 0.0189 0.0269 +42.33%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 27.16 KiB 27.16 KiB +4 B
RUM - add action 96.25 KiB 101.86 KiB +5.61 KiB
RUM - add timing 27.20 KiB 26.24 KiB -980 B
RUM - add error 90.19 KiB 92.14 KiB +1.95 KiB
RUM - start/stop session replay recording 25.41 KiB 25.86 KiB +463 B
RUM - start view 482.05 KiB 477.33 KiB -4.72 KiB
Logs - log message 88.43 KiB 100.41 KiB +11.98 KiB

🔗 RealWorld

@datadog-official
Copy link
Copy Markdown

datadog-official bot commented Mar 31, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 68.42%
Overall Coverage: 77.25% (-0.04%)

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

@BeltranBulbarellaDD
Copy link
Copy Markdown
Contributor Author

@codex pls review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0a30fc683c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@BeltranBulbarellaDD
Copy link
Copy Markdown
Contributor Author

@codex pls review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 86e5acfaf2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@BeltranBulbarellaDD
Copy link
Copy Markdown
Contributor Author

@codex pls review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3416d19292

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@BeltranBulbarellaDD BeltranBulbarellaDD marked this pull request as ready for review April 2, 2026 14:53
@BeltranBulbarellaDD BeltranBulbarellaDD requested a review from a team as a code owner April 2, 2026 14:53
@BeltranBulbarellaDD BeltranBulbarellaDD changed the title Add Nuxt plugin with router tracking ⚗️ Add Nuxt plugin with router tracking Apr 2, 2026
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