intermediate
Sentry
Track frontend and backend errors with releases, stack traces, source maps, breadcrumbs, performance spans, and issue ownership.
Sentry focuses on **application errors and performance** for frontend and backend: stack traces, release health, breadcrumbs, user context (safely), and issue assignment. It complements metrics-first APM for developer-centric debugging.
Sentry.init({
dsn: process.env.SENTRY_DSN,
release: process.env.GIT_SHA,
tracesSampleRate: 0.1,
});
| Feature | Value | |---------|-------| | Source maps | Readable frontend stacks | | Releases | Regressions per deploy | | Performance | Transaction traces for slow pages | | Issue owners | Route errors to teams |
Scrub PII in `beforeSend`. Tie releases to CI deploys. Do not use Sentry as a log drain.
On interviews: sampling, distinguishing errors vs transactions, and correlating Sentry events with backend trace IDs.
Common pitfalls: logging PII in breadcrumbs; 100% trace sampling cost; ignoring release-based regression alerts.
The trade-off is rich error context versus volume, privacy, and vendor spend.
Checklist:
- Upload source maps in CI.
- Tag releases with git SHA.
- Scrub sensitive fields.
- Sample performance traces.