sentry-instrumentation
БесплатноБез исполняемых скриптовНе проверенDecide whether and how errors report to Sentry. Use when touching capture or error-handling paths in `web/**`, triaging Sentry noise, or changing Sentry…
от langfuse★ 38 069 звёзд на GitHubОб этом скилле
Sentry Instrumentation
One idea: an event in Sentry is a promise that a human should act. If
nobody would act on it, do not send it. If you send it, make it legible (a
real Error with a stack — never a string/object/SyntheticEvent) and
routable (an area tag, a message stable enough to group). Sentry is not a
log sink; the server-side observability stack is where firehose logs live.
Decide capture when adding an error path
When adding or changing an error path in web/**, decide explicitly whether it
should reach Sentry — do not captureException (or console.error) reflexively.
Run the decision tree, then say in one line what you chose and why (in the plan
or PR description). The three outcomes:
| The failure is… | Do | Never |
|---|---|---|
| an expected user-facing state — a missing/forbidden resource, expired session, invalid user input, a malformed URL in user content | render the UX (error page / toast / plain text) | capture — it is the product working as designed |
| a transport / offline / infra failure — fetch failed, a 5xx on a poll, an LB blip | let the UI degrade; the server owns this signal | capture client-side — it is an amplified, lower-fidelity copy of a server truth |
| our code failed — an invariant broke, a parse threw, a worker failed to load | captureException a real Error with an area tag via the shared helpers |
pass a raw string/object/Event |
console.error is a capture API here. instrumentation-client.ts enables
captureConsoleIntegration({ levels: ["error"] }), so every console.error
becomes a Sentry event. Logging an object yields an opaque [object Object]
fingerprint; logging non-actionable info still mints an issue. For
non-actionable logging use console.warn; to report a real failure, capture it
properly (below).
The Langfuse pattern (match it exactly)
- Report caught unknowns through the shared helpers, not raw
captureException:captureUnknownError(context, value, extra?)— turns any caught value into a legibleError(realErrors pass through with their stack; everything else is synthesized), tagsarea, and logs viaconsole.warnso the console integration does not double-capture.reportWorkerLoadError({area, source, event, extra?})— extracts the real fields from a WorkerErrorEvent(message/filename/lineno/colno) instead of stringifying it to[object ErrorEvent]. Every worker'sonerrorreports through this one;reportParserWorkerError(hook, event)is the JSON-parser worker's thin wrapper over it.
- Filter predicates belong in
web/src/utils/sentryFilters.ts(documented, unit-tested), called frombeforeSendinweb/instrumentation-client.ts(the onlySentry.initin the codebase —beforeSend,captureConsoleIntegration,denyUrls, replay masking). Add every new filter as a named predicate there, never as an ad-hoc inline check.beforeSendnow holds NO inline checks — every filter routes through a named predicate (isNoisyHttpClientPollEvent,isDenylistedNoiseEvent,isReactDevtoolsInternalEvent). Keep it that way. - Classify tRPC errors at the seam, not per call site:
handleTrpcError(web/src/utils/api.ts) is the single chokepoint every query/mutation error flows through — the place to drop expected codes and tag the rest (the seam-classification lever, PR #15243). - Tag
area, keep the message static.captureException(err, { tags: { area }, extra }). Fingerprints group on the message, so put variable IDs inextra, never in the message string.
The rules (each earned the hard way — cited to workstream PRs)
PR references name the lever that established each pattern. Verify a cited symbol or swap against the current tree before relying on it — the code, not this doc, is the source of truth.
- **An event is
Установить sentry-instrumentation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл sentry-instrumentation?
Decide whether and how errors report to Sentry. Use when touching capture or error-handling paths in `web/**`, triaging Sentry noise, or changing Sentry settings.
Как установить скилл sentry-instrumentation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sentry-instrumentation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic