@sentry/node
11.9.0 · 23 Oct 2026MIT36.1M / weekRepositoryHomepagenpmAtom feed
9.47.2 is the newest release of 9.x.
In short
4 new1 fixed1 changed2 internal
Release note
Important Changes
Add support for logs
feat(node): Add logging public APIs to Node SDKs
feat(core): Add support for
beforeSendLogfeat(core): Add support for parameterizing logs
fix: Remove critical log severity level
All JavaScript SDKs other than
@sentry/cloudflareand@sentry/denonow support sending logs via dedicated methods as part of Sentry's upcoming logging product.Logging is gated by an experimental option,
_experiments.enableLogs.Sentry.init({ dsn: 'PUBLIC_DSN', // `enableLogs` must be set to true to use the logging features _experiments: { enableLogs: true }, }); const { trace, debug, info, warn, error, fatal, fmt } = Sentry.logger; trace('Starting database connection', { database: 'users' }); debug('Cache miss for user', { userId: 123 }); error('Failed to process payment', { orderId: 'order_123', amount: 99.99 }); fatal('Database connection pool exhausted', { database: 'users', activeConnections: 100 }); // Structured logging via the `fmt` helper function. When you use `fmt`, the string template and parameters are sent separately so they can be queried independently in Sentry. info(fmt(`Updated profile for user ${userId}`)); warn(fmt(`Rate limit approaching for endpoint ${endpoint}. Requests: ${requests}, Limit: ${limit}`));With server-side SDKs like
@sentry/node,@sentry/bunor server-side of@sentry/nextjsor@sentry/sveltekit, you can do structured logging without needing thefmthelper function.const { info, warn } = Sentry.logger; info('User %s logged in successfully', [123]); warn('Failed to load user %s data', [123], { errorCode: 404 });To filter logs, or update them before they are sent to Sentry, you can use the
_experiments.beforeSendLogoption.browser: Add
diagnoseSdkConnectivity()function to programmatically detect possible connectivity issuesThe
diagnoseSdkConnectivity()function can be used to programmatically detect possible connectivity issues with the Sentry SDK.const result = await Sentry.diagnoseSdkConnectivity();
The result will be an object with the following properties:
"no-client-active": There was no active client when the function was called. This possibly means that the SDK was not initialized yet."sentry-unreachable": The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.undefined: The SDK is working as expected.
SDK Tracing Performance Improvements for Node SDKs
feat: Stop using
dropUndefinedKeysfeat(node): Only add span listeners for instrumentation when used
ref: Avoid
dropUndefinedKeysforspanToJSONcallsref: Avoid using
SentryErrorfor PromiseBuffer control flowref: Stop using
dropUndefinedKeysin SpanExporterref(core): Avoid using
SentryErrorfor event processing control flowref(node): Avoid
dropUndefinedKeysin Node SDK initref(opentelemetry): Avoid sampling work for non-root spans
We've been hard at work making performance improvements to the Sentry Node SDKs (
@sentry/node,@sentry/aws-serverless,@sentry/nestjs, etc.). We've seen that upgrading from9.7.0to9.10.0leads to 30-40% improvement in request latency for HTTP web-server applications that use tracing with high sample rates. Non web-server applications and non-tracing applications will see smaller improvements.
Other Changes
Always truncate stored breadcrumb messages to 2kb
nextjs: Disable server webpack-handling for static builds
nuxt: Don't override Nuxt options if undefined