Sentry
Error and performance monitoring for Node.js with exception capture, breadcrumbs, user context, tracing, and release tracking.
Official Documentation ↗Sentry Node SDK 8.x; integration setup and tracing APIs change across major versions. Check the official docs for the latest API surface.Installation
npm install @sentry/nodepnpm add @sentry/nodeyarn add @sentry/nodeMethods
No methods match this filter.
Sentry captures exceptions and performance data from Node.js services. It groups similar errors, attaches context, and attributes events to releases. It is not a replacement for structured logs or metrics.
Initialize early, release deliberately
Initialize the SDK before handling requests and set environment and release. Without a release, an error cannot be tied to a deploy and regression detection is weak. Upload source maps or debug symbols so stack traces point to source.
Capture at the boundary
Capture unexpected exceptions once, at the request or job boundary, then rethrow or return a safe response. Avoid capturing expected validation errors as exceptions; use them as part of normal control flow. Add non-sensitive tags such as route and operation.
Protect personal data
Configure beforeSend to scrub headers, cookies, and request bodies. Do not send credentials or unnecessary personal data. Review a sample of events after enabling the SDK, and document retention and access in the privacy policy.
Errors
The following points are quoted verbatim from the official documentation. 来源:https://docs.sentry.io/platforms/javascript/guides/node/ · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:52:26.449Z. Any error type, throw condition or recovery step not stated there is left unspecified; this page does not infer exception classes or return values.
- Issues (always enabled) : Sentry's core error monitoring product that automatically reports errors, uncaught exceptions, and crashes. (https://docs.sentry.io/platforms/javascript/guides/node/)
- If you have something that looks like an exception, Sentry can capture it. (https://docs.sentry.io/platforms/javascript/guides/node/)
- Tracing : Track software performance while seeing the impact of errors across multiple systems. (https://docs.sentry.io/platforms/javascript/guides/node/)
FAQ
- Does Sentry replace logs or metrics?
- No. It groups errors and traces, but structured logs and metrics answer different questions. Use correlation ids to connect them.
- What should never be sent to Sentry?
- Passwords, tokens, authorization headers, full request bodies, and unnecessary personal data. Configure scrubbing and review events before enabling production.
- How do I know which release introduced an error?
- Set the release to the commit SHA or version and upload source maps or debug symbols. Compare error rates and first-seen versions in the release view.
Report a problem with this API docOpens a pre-filled issue on GitHub.