Filter Node.js deprecation warnings from Sentry breadcrumbs

Node.js v24 emits DEP0169 (url.parse()) and DEP0040 (punycode) deprecation
warnings from dependencies like Express 4 and URL-processing libraries.
These warnings are captured by Sentry as error-level console breadcrumbs,
creating noise in performance transaction monitoring. Filter them out using
beforeBreadcrumb to keep Sentry data clean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sonarly Claude Code
2026-02-19 06:23:36 +00:00
co-authored by Claude Opus 4.6
parent db9636bd9e
commit aad3d98338
+10
View File
@@ -41,6 +41,16 @@ if (process.env.EXCEPTION_HANDLER_DRIVER === ExceptionHandlerDriver.SENTRY) {
}),
nodeProfilingIntegration(),
],
beforeBreadcrumb(breadcrumb) {
if (
breadcrumb.category === 'console' &&
breadcrumb.message?.includes('DeprecationWarning')
) {
return null;
}
return breadcrumb;
},
tracesSampleRate: 0.1,
profilesSampleRate: 0.3,
sendDefaultPii: true,