All skills
datadog-labs avatar

/dd-instrument-rum

@659ea9a official

Instrument browser-based web applications with Datadog Browser RUM. Detect the application framework, router, package manager, bundler, entrypoint, credentials, and existing RUM setup; add or safely complete classic Browser RUM instrumentation for React, Next.js App or Pages Router, Angular, Vue, Nuxt, Svelte, vanilla JavaScript, SPAs, and iframe-hosted apps; avoid duplicate initialization; and verify the application still builds. Use when asked to add, set up, instrument, repair, or verify Datadog RUM, Browser Monitoring, Session Replay, or framework-specific Browser RUM plugins.

Use this Skill: https://skilld.dev/gh/datadog-labs/agent-skills/dd-instrument-rum

This session only. Nothing lands on disk.

referencesrum-vue.md

≈459 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Vue integration

Read rum-core.md first. Use this file for Vue applications that are not Nuxt.

Prerequisites and packages

Require Vue 3.5 or later. When router tracking is used, require Vue Router v4 or v5. Stop without editing for Vue 2, Vue 3.4 or earlier, or an unsupported router version.

Install @datadog/browser-rum and @datadog/browser-rum-vue at the same exact version.

Initialize before createApp(...):

import { datadogRum } from '@datadog/browser-rum'
import { vuePlugin } from '@datadog/browser-rum-vue'

datadogRum.init({
  // ...canonical fields from rum-core.md...
  plugins: [vuePlugin()],
})

Error integration

After creating the Vue app and before mounting it, register addVueError as the global handler:

import { addVueError } from '@datadog/browser-rum-vue'

const app = createApp(App)
app.config.errorHandler = addVueError

If app.config.errorHandler already exists, preserve it and add one addVueError(error, instance, info) call inside that handler or a small chaining wrapper. Do not overwrite custom behavior and do not report an error twice.

Router integration

When the application actively uses Vue Router, initialize with vuePlugin({ router: true }) and replace only Vue Router's createRouter import:

- import { createRouter } from 'vue-router'
+ import { createRouter } from '@datadog/browser-rum-vue/vue-router'

Keep createWebHistory, createWebHashHistory, route types, and other exports imported from vue-router. The version-agnostic Datadog entrypoint supports the detected Vue Router v4 or v5; do not introduce the older vue-router-v4 path in new instrumentation.

Keep initialization, router construction, createApp, error-handler registration, app.use(router), and app.mount(...) in their existing lifecycle order.

Source: SKILL.md on GitHub

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill performs automated instrumentation of web applications using Datadog Browser RUM. It executes standard build and installation commands and ingests project source files, presenting a standard attack surface for indirect prompt injection common to developer tools.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at 659ea9a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
Other metadata
metadata
{
  "version": "0.1.0",
  "author": "datadog-labs",
  "repository": "https://github.com/datadog-labs/agent-skills",
  "tags": "datadog,rum,browser-rum,instrumentation,session-replay,react,nextjs,angular,vue,nuxt,svelte",
  "alwaysApply": "false"
}

README badge

README badge for datadog-labs/agent-skills/dd-instrument-rum