/agent-skills:dd-instrument-error-trackingfrom agent-skills
Enables Datadog Browser Error Tracking for web apps using the RUM Browser SDK. Configures error processing state and forwards framework-caught errors (React, Next.js, Vue, Angular, SvelteKit) to Datadog, then verifies event delivery.
Ships in agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Browser Error Tracking groups and triages frontend exceptions collected by the Datadog RUM Browser SDK (@datadog/browser-rum). It shares the same SDK and the same RUM application as Browser RUM and Product Analytics, so there is no separate Error Tracking SDK to install.
rum_event_processing_state is ERROR_FOCUSED_MODE or ALL. An application created for Product Analytics only starts at NONE, which drops all RUM and Error Tracking events even when the browser code is wired.sessionSampleRate. The RUM Browser SDK captures unhandled errors (window.onerror, unhandledrejection, console.error) automatically for sampled sessions. There is no errorSampleRate option in RumInitConfiguration; adding it breaks TypeScript builds.error.tsx, Vue app.config.errorHandler, Angular ErrorHandler, and SvelteKit handleError intercept errors before they reach window.onerror, so those hooks must forward caught errors to Datadog.Copy these steps into your reply and tick them off as you go.
Inspect. Find the browser app; in a monorepo with several, ask which one. Search source and HTML files, skipping node_modules and build output, for the RUM setup: an init call on the datadogRum import from @datadog/browser-rum, including renamed imports and wrapper modules, or a CDN DD_RUM.init. Record the number of inits, the framework, sessionSampleRate, the site (absent means datadoghq.com), the application ID, any @datadog/browser-rum-* or @datadog/browser-logs packages, and any existing error boundary or framework error handler. When the init reads the application ID or the site from environment variables, read only those lines of the env file, for example grep -E '^VITE_DD_(RUM_APPLICATION_ID|SITE)=' .env.local, because env files often hold secrets.
Check what Error Tracking needs.
dd-instrument-rum skill. Ask whether to set up RUM now. On yes, run that skill; when it is not installed, get it from that link or follow the Browser Monitoring setup docs. Then restart at step 1, and if there is still no init with an application ID, stop and report it. On no, or when you cannot ask, end without changes and report that RUM is missing.Turn Error Tracking processing on. Check for both keys without printing them: [ -n "$DD_API_KEY" ] && [ -n "$DD_APP_KEY" ] && echo set. With keys, follow references/api-switch.md: it reads the current state, leaves ALL or ERROR_FOCUSED_MODE untouched, and sends rum_event_processing_state: ERROR_FOCUSED_MODE only when the current state is NONE. Without keys, or after a failure, give the user the settings step: in Datadog, open Digital Experience > Real User Monitoring > Manage Applications, select the application, and under Application Settings enable Error Tracking event processing. Build APP_HOST as described in Verify and view. When the Datadog MCP server has the RUM toolset, Datadog:search_rum_applications reports rum_event_processing_state, which confirms either path.
Check session sampling and Logs forwarding.
datadogRum.init sets sessionSampleRate: 0, no sessions are sampled and no errors are sent; ask before changing it to 100. When sessionSampleRate is absent, leave it alone (it defaults to 100). Never add errorSampleRate.@datadog/browser-logs is already installed and datadogLogs.init is present without forwardErrorsToLogs, add forwardErrorsToLogs: true. Do not install @datadog/browser-logs from scratch, because Browser Logs is a separate product with its own setup.datadogRum.init unchanged.Forward framework-caught errors. Open references/framework-errors.md and wire the error hook for the detected framework (React, Next.js, Vue, Nuxt, Angular, or SvelteKit) so errors caught by the framework are reported to Datadog without replacing existing UI or reporting the same error twice. Plain JavaScript, plain Svelte, and CDN apps need no framework hook.
Build and run. Run the project's build, fix errors your edits caused, and run it again until it passes. Then start the app with its dev command, load a page, keep the page open for about 30 seconds, and stop the server. The SDK sends its batch every 30 seconds or when the page is hidden.
Record the highest level you actually reached:
browser-intake-… host, or to the init's proxy URL, with path /api/v2/rum, returned 202. Check in a headless browser when one is available, or ask the user to look in DevTools > Network.Datadog:search_datadog_rum_events, or the Search RUM events endpoint with the same keys, finds @application.id:<APP_ID> @session.initial_view.url_host:localhost in the last 15 minutes. A new application can take a few minutes to show data, so query once a minute for up to 10 minutes; if nothing arrives, stop at level 3 and give the link.A passing build shows only that the project compiles. Name each level you could not check and the step left for the user.
The app host is app.datadoghq.com for datadoghq.com, app.datadoghq.eu for datadoghq.eu, app.ddog-gov.com for ddog-gov.com, and the site itself for the others, for example us5.datadoghq.com. End with this summary:
Error Tracking: turned on | already on | waiting for your settings step (<the step>)
Changed: <files, or none>
Evidence: <highest level reached>; not checked: <levels and the step left>
View: https://APP_HOST/[email protected]:<APP_ID>
Revert this run's code edits (framework error hook or boundary). If this run changed rum_event_processing_state from NONE to ERROR_FOCUSED_MODE, follow the undo note in references/api-switch.md. Leave the RUM setup as it is.
| Mistake | Symptom | Fix |
|---|---|---|
Sending rum_event_processing_state: ERROR_FOCUSED_MODE when the app is at ALL | Downgrades full RUM and drops non-error sessions | Read the state first; update only when it is NONE |
Sending product_analytics_retention_state: NONE in the update | Turns Product Analytics off for the app | Omit product_analytics_retention_state from the PATCH body |
Adding errorSampleRate to datadogRum.init | TypeScript build fails (errorSampleRate is not a valid option) | Use sessionSampleRate (defaults to 100) |
Calling datadogRum.addError in server-only Next.js or SvelteKit code | Server error is never sent by the browser SDK | Call it in a client error boundary ('use client') or hooks.client |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
78 skills in this plugin
/agent-observability-auto-experimentRun an iterative code-improvement hill-climb against real Datadog LLM-Obs data, locally, with Claude Code as the agent. Establishes a baseline eval, makes one focused change, re-scores both splits with the same harness, keeps the change when held-out test improves without overfitting val (labeling within-noise gains tentative), and repeats. This is the skill published as "Autoresearch" in Datadog Agent Observability. Use when the user says "run an auto experiment", "run autoresearch", "hill-climb this code", "iteratively improve X and measure the delta", "optimize this code/agent/pipeline/prompt against my traces", "auto-optimize against LLM-Obs", or wants the local equivalent of the auto_experiments worker. Works from an ml_app, a dataset_id, an annotation_queue_id (a queue of human-labelled interactions), a list of trace_ids, or (by exception) a local dataset file. The corpus and its val/test splits live in Datadog LLM-Obs Datasets, created once per run with a timestamp in their names./agent-observability-build-eval-from-annotationsFit a Datadog LLM-Obs evaluator to human labels. Takes an annotation queue, works out where in the trace the labelled property actually lives, drafts an LLM-judge that predicts the human label, scores that judge against the already-labelled rows with a metric agreed with the user, then hill-climbs it — inspect the errors, make one focused change, re-score, keep it only if it beats the best — for a bounded number of iterations, and finally publishes the winner to Datadog as a DISABLED evaluator (not a Datadog draft — a real evaluator with `enabled: false`). Use when the user says "build an eval from my annotations", "build an evaluator from the annotation queue", "turn my annotations into an evaluator", "learn an evaluator from my labels", "fit a judge to the annotation queue", "auto-label", "auto labelling", "automate this annotation queue", "scale up my human labels", or wants the rest of a queue graded the way the humans graded the first rows. Needs an annotation queue with at least two classes present in the human labels (e.g. one true and one false for a boolean).npx claudepluginhub datadog-labs/agent-skills --plugin agent-skillsOther plugins' skills for the same job