/agent-skills:upgrade-browser-sdk-v6from agent-skills
Migrates Datadog Browser SDK from v5 to v6: updates CDN/npm versions, removes deprecated options, and drops IE11 support.
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.
None: SKILL.md is the whole skill.
Systematic migration guide from v5 to v6. Follow steps 1-6 in order. Each step includes a search pattern to find affected code.
CDN setup — update script src URLs:
| v5 pattern | v6 replacement |
|---|---|
datadoghq-browser-agent.com/us1/v5/datadog-rum.js | datadoghq-browser-agent.com/us1/v6/datadog-rum.js |
datadoghq-browser-agent.com/us1/v5/datadog-logs.js | datadoghq-browser-agent.com/us1/v6/datadog-logs.js |
datadoghq-browser-agent.com/us1/v5/datadog-rum-slim.js | datadoghq-browser-agent.com/us1/v6/datadog-rum-slim.js |
Replace us1 with your site: eu1, us3, us5, ap1, ap2. For US1-FED, the pattern is flat with no site prefix: datadog-rum-v6.js, datadog-logs-v6.js, datadog-rum-slim-v6.js.
Search: grep -r "datadoghq-browser-agent.com.*v5" --include="*.html" --include="*.js" --include="*.ts" --include="*.tsx" --include="*.jsx"
npm setup — update package.json dependencies:
"@datadog/browser-rum": "^6.0.0"
"@datadog/browser-logs": "^6.0.0"
"@datadog/browser-rum-slim": "^6.0.0"
Then run your package manager (npm install, yarn install, etc.) and rebuild.
Also upgrade framework integrations to v6 if used: @datadog/browser-rum-react.
Search: grep -r "@datadog/browser-" --include="package.json" .
| Option | Action |
|---|---|
useCrossSiteSessionCookie | Replace with usePartitionedCrossSiteSessionCookie. |
| Option | Action |
|---|---|
sendLogsAfterSessionExpiration | Delete. In v6, logs are always sent after session expiration (without a session ID). The option is no longer needed. |
Search: grep -rn 'useCrossSiteSessionCookie\|sendLogsAfterSessionExpiration' --include="*.js" --include="*.ts" --include="*.tsx" --include="*.jsx" --include="*.html" --include="*.vue" --include="*.svelte"
v6 changes several default behaviors. Review each and adjust if needed:
trackUserInteractions, trackResources, and trackLongTasks default to trueIn v5, these were false by default. In v6, they are enabled out of the box. This does not impact billing.
To preserve v5 behavior, explicitly disable only the options that were not already enabled in v5. If an option was already true in v5, leave it unchanged:
DD_RUM.init({
trackUserInteractions: false, // only if not already true in v5
trackResources: false, // only if not already true in v5
trackLongTasks: false, // only if not already true in v5
})
traceContextInjection defaults to "sampled"In v5, trace context was injected for all requests. In v6, it's only injected for sampled traces. If your traceSampleRate is 100% (the default), this has no impact.
To preserve v5 behavior:
DD_RUM.init({
traceContextInjection: 'all',
})
tracestate header added with tracecontext propagatorThe tracecontext propagator now sends an additional tracestate header. Your server must accept it. Add it to your existing Access-Control-Allow-Headers — do not replace the full list:
# Add tracestate alongside your existing headers
Access-Control-Allow-Headers: <existing-headers>, traceparent, tracestate
site parameter is strongly typedThe site option has a stricter TypeScript type. If you pass a non-standard value, you get a type error. Use proxy for non-standard intake URLs instead.
Search: grep -rn 'trackUserInteractions\|trackResources\|trackLongTasks\|traceContextInjection\|tracestate\|allowedTracingUrls\|propagatorTypes' --include="*.js" --include="*.ts" --include="*.tsx" --include="*.jsx" --include="*.html" --include="*.vue" --include="*.svelte"
Also search for all RUM init calls to catch projects that omit these options and relied on the v5 false defaults: grep -rn 'DD_RUM\.init\|datadogRum\.init' --include="*.js" --include="*.ts" --include="*.tsx" --include="*.jsx" --include="*.html" --include="*.vue" --include="*.svelte". For each init call, check whether trackUserInteractions, trackResources, and trackLongTasks are explicitly set — if omitted, they now default to true in v6.
Session Replay is now lazy-loaded using dynamic imports. The module loads only for sessions sampled for replay, reducing bundle size for others.
Ensure your bundler supports dynamic imports (code splitting). Most modern bundlers do:
No code changes needed. The SDK dynamically loads an additional chunk when recording (e.g., datadogRecorder-<hash>-datadog-rum.js). Update CSP script-src rules if needed to allow the chunk.
| Change | Impact | Action if needed |
|---|---|---|
| IE11 support dropped | SDK built with ES2018 target. Polyfills removed. | Keep using v5 if IE11 support is required. |
| Long Animation Frames replace Long Tasks | On supported browsers, Long Animation Frames are collected instead of Long Tasks. Event type is still long_task. | Review if you inspect long task event details. |
| Session cookie expiration extended to 1 year | Supports anonymous user tracking. | Set trackAnonymousUser: false to opt out. |
RegExp and Event objects sanitized | These are no longer serialized as-is in context/attributes. | Use string representations if you were passing RegExp or Event objects. |
Webpack ChunkLoadError no longer collected | Reduces noise from SDK chunk loading failures. | No action needed. |
tracestate to your existing Access-Control-Allow-Headers if using the tracecontext propagator (do not replace the full list): Access-Control-Allow-Headers: <existing-headers>, traceparent, tracestatedatadogRecorder-*-datadog-rum.js) in script-src rules.| Mistake | What goes wrong | Fix |
|---|---|---|
Defensively disabling trackUserInteractions, trackResources, trackLongTasks | Disables features the project needs — these now default to true, which is usually the desired behavior | Only set these to false if the project explicitly did not want them; leave them unset to accept the new defaults |
Missing tracestate in Access-Control-Allow-Headers | The tracecontext propagator now sends a tracestate header — cross-origin requests are blocked by CORS | Add tracestate alongside traceparent in your server's Access-Control-Allow-Headers |
Not updating CSP script-src for the lazy-loaded Session Replay chunk | Recording silently fails on CSP-restricted pages — the dynamic chunk is blocked | Allow datadogRecorder-*-datadog-rum.js in script-src |
After upgrading, confirm:
useCrossSiteSessionCookie, sendLogsAfterSessionExpiration)tracestate header)site parameter typingWhat 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