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-angular.md

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

Angular integration

Read rum-core.md first.

Prerequisites and packages

Require Angular 15 through 22 and RxJS 7 or later. If Angular routing is used, require a matching supported @angular/router major. Stop without editing when these prerequisites are unmet.

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

Initialize at module scope before bootstrapApplication(...) or platformBrowserDynamic().bootstrapModule(...):

import { datadogRum } from '@datadog/browser-rum'
import { angularPlugin } from '@datadog/browser-rum-angular'

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

Error integration

Detect existing Angular error handling before editing.

  • With no custom ErrorHandler, import and register provideDatadogErrorHandler() in the existing standalone bootstrap providers or NgModule providers.
  • With a custom ErrorHandler, preserve it and call addAngularError(error) from its existing handleError method. Do not replace it with provideDatadogErrorHandler().
  • If either Datadog path already exists, do not add another error report path.

For standalone bootstrap:

bootstrapApplication(AppComponent, {
  providers: [provideDatadogErrorHandler()],
})

For an NgModule, add the provider to that module's existing providers array.

Router integration

Enable router tracking only when the app actually configures Angular Router through provideRouter, RouterModule.forRoot, or equivalent active setup.

Use one plugin instance and one provider:

import { angularPlugin, provideDatadogRouter } from '@datadog/browser-rum-angular'

datadogRum.init({
  // ...canonical fields...
  plugins: [angularPlugin({ router: true })],
})

Add provideDatadogRouter() to the existing standalone or NgModule providers. Do not introduce Angular Router to an application that does not already use it.

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