dd-instrument-error-tracking
БесплатноБез исполняемых скриптовНе проверенSets up Datadog Browser Error Tracking for a web app that runs the Datadog RUM Browser SDK. Turns error processing on for the app's RUM application, forwards…
от datadog-labs★ 188 звёзд на GitHubОб этом скилле
Datadog Browser Error Tracking
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.
How it works
- The switch is on the RUM application, not in the code. A RUM application processes errors when
rum_event_processing_stateisERROR_FOCUSED_MODEorALL. An application created for Product Analytics only starts atNONE, which drops all RUM and Error Tracking events even when the browser code is wired. - RUM comes first. Browser Error Tracking reads what the RUM Browser SDK sends, so an app with no RUM init needs RUM set up first.
- Sampling uses
sessionSampleRate. The RUM Browser SDK captures unhandled errors (window.onerror,unhandledrejection,console.error) automatically for sampled sessions. There is noerrorSampleRateoption inRumInitConfiguration; adding it breaks TypeScript builds. - Frameworks swallow component errors. React error boundaries, Next.js
error.tsx, Vueapp.config.errorHandler, AngularErrorHandler, and SvelteKithandleErrorintercept errors before they reachwindow.onerror, so those hooks must forward caught errors to Datadog. - Credentials. The application ID and client token are public and already in the RUM setup. Switching event processing on through the API needs an API key and an application key, and both are secret.
Set up
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_modulesand build output, for the RUM setup: aninitcall on thedatadogRumimport from@datadog/browser-rum, including renamed imports and wrapper modules, or a CDNDD_RUM.init. Record the number of inits, the framework,sessionSampleRate, thesite(absent meansdatadoghq.com), the application ID, any@datadog/browser-rum-*or@datadog/browser-logspackages, 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 examplegrep -E '^VITE_DD_(RUM_APPLICATION_ID|SITE)=' .env.local, because env files often hold secrets.Check what Error Tracking needs.
- No browser app, for example a backend service or a mobile app: stop before any edit and report that this skill covers browser apps only. Do not offer Browser RUM, because it cannot collect errors from that project.
- No RUM init: stop before any edit. Tell the user that Browser Error Tracking collects its data through the RUM Browser SDK, that this app has none, and that RUM must be set up first with the
dd-instrument-rumskill. 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. - Two or more inits, or npm and CDN setups mixed: stop and report each location, because a second init splits sessions and errors between configurations. Repairing that belongs to RUM setup.
- No application ID found: ask the user. It is listed under Real User Monitoring > Manage Applications in Datadog.
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, leavesALLorERROR_FOCUSED_MODEuntouched, and sendsrum_event_processing_state: ERROR_FOCUSED_MODEonly when the current state isNONE. 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. BuildAPP_HOSTas described in Verify and view. When the Datadog MCP server has the RUM toolset,Datadog:search_rum_applicationsreportsrum_event_processing_state, which confirms either path.Check session sampling and Logs forwarding.
- If the existing
datadogRum.initsetssessionSampleRate: 0, no sessions are sampled and no errors are sent; ask before changing it to100. WhensessionSampleRateis absent, leave it alone (it defaults to100). Never adderrorSampleRate. - If
@datadog/browser-logsis already installed anddatadogLogs.initis present withoutforwardErrorsToLogs
- If the existing
Установить dd-instrument-error-tracking в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл dd-instrument-error-tracking?
Sets up Datadog Browser Error Tracking for a web app that runs the Datadog RUM Browser SDK. Turns error processing on for the app's RUM application, forwards framework-caught errors (React, Next.js, Vue, Angular, SvelteKit) to Datadog, and checks that events arrive. Use when asked to add, set up, enable or verify Error Tracking or frontend exception tracking in a browser app. Not for adding RUM itself, which dd-instrument-rum does first, or for uploading source maps, which dd-browser-sdk does.
Как установить скилл dd-instrument-error-tracking?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dd-instrument-error-tracking запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic