sentry
Installation
SKILL.md
Sentry
Overview
Sentry is an error monitoring and performance platform that captures unhandled exceptions, tracks request performance with Web Vitals, records session replays, and alerts on regressions. It supports JavaScript, Python, Go, and mobile platforms with auto-instrumentation, source-mapped stack traces, and release health tracking.
Instructions
- When integrating the SDK, call
Sentry.init()withdsn,environment,release, andtracesSampleRate, choosing the framework-specific SDK (@sentry/nextjs,@sentry/sveltekit,sentry-sdkfor Python) for automatic instrumentation. - When configuring error tracking, set up
Sentry.setUser()after login for user correlation, add custom tags withSentry.setTag()for filtering, and configureignoreErrorsfor known harmless errors from browser extensions and third-party scripts. - When uploading source maps, use
@sentry/vite-pluginor@sentry/webpack-pluginin the CI build step to map minified stack traces back to original source code, associating them with the release version. - When monitoring performance, set
tracesSampleRateto 0.1-0.2 in production, add custom spans withSentry.startSpan()for business-critical operations, and monitor Web Vitals (LCP, CLS, INP) for real user experience. - When setting up alerts, configure rules for error rate spikes rather than individual errors, integrate with Slack or PagerDuty, and filter by environment and error level.
- When using session replay, set
replaysOnErrorSampleRate: 1.0for all error sessions andreplaysSessionSampleRate: 0.1for general sampling, with privacy masking for sensitive data.