Error Tracking (Sentry)
Capture, aggregate, and triage application errors in real-time with full stack traces and contextual data.
Description
Error tracking captures unhandled exceptions, rejected promises, and explicit error reports from applications in real-time, aggregating them by root cause and providing rich context for debugging. Sentry is the most widely adopted error tracking platform, supporting dozens of languages and frameworks with SDKs that capture stack traces, breadcrumbs (a trail of events leading to the error), request data, user context, and environment metadata.
Sentry groups similar errors into 'issues' using fingerprinting algorithms, preventing alert fatigue from repeated occurrences of the same error. Each issue shows the error count over time, affected user count, first and last seen dates, and a list of events with full context. Source maps (for JavaScript) are uploaded during the build process to map minified production stack traces back to original source code. Release tracking correlates errors with specific deployments, enabling quick identification of regressions.
Beyond basic error capture, Sentry provides performance monitoring (transaction tracing), session replay (recording user interactions leading to errors), and cron monitoring (detecting failed or missed scheduled jobs). Integration with issue trackers (Jira, Linear, GitHub Issues), alerting channels (Slack, PagerDuty), and source control (GitHub, GitLab) streamlines the triage-to-fix workflow. Sampling rates should be configured to balance cost with coverage -- 100% for errors, with a lower sample rate for performance transactions.
Prompt Snippet
Integrate Sentry SDK (@sentry/node and @sentry/react) with DSN from environment variables. Configure 100% error sample rate and 20% performance transaction sample rate. Upload source maps during CI/CD using @sentry/cli with the release set to the git SHA. Set up Sentry release tracking to associate errors with deployments and enable suspect commits. Attach user context (id, email, subscription tier) without including PII in breadcrumbs. Configure beforeSend to scrub sensitive headers and request body fields. Set up alert rules: notify Slack on first occurrence of new issues, escalate to PagerDuty if an issue affects >100 users in 1 hour. Add Sentry cron monitoring for all scheduled jobs to detect silent failures.
Tags
Related Terms
Application Monitoring (APM)
Monitor application performance, trace requests across services, and identify bottlenecks using APM instrumentation.
Application Logging (Structured)
Emit application logs as structured, machine-parseable records with consistent fields for efficient searching and analysis.
Uptime Monitoring
Continuously check application availability from external locations and alert when endpoints become unreachable or slow.