feat(node): Support Node 26#20710
Conversation
|
Depends on this (or something similar) to be released: getsentry/sentry-javascript-profiling-node-binaries#32 |
b019b0b to
c876f25
Compare
d128f42 to
b82c941
Compare
We want to leverage this for Node 26 to filter deprecation messages from IITM, but this could also be used by users if they want to silence certain things. Required for #20710
size-limit report 📦
|
| const core = coreConsoleIntegration({ | ||
| ...options, | ||
| filter: [ | ||
| ...(options.filter || []), | ||
| // Deprecation on Node 26 for module.require(), which is used by IITM | ||
| '[DEP0205] DeprecationWarning', | ||
| ], | ||
| }); | ||
| core.setup?.(client); | ||
| }, |
There was a problem hiding this comment.
Bug: The Lambda-specific console instrumentation instrumentConsoleLambda bypasses configured filters, causing all console messages to be captured as breadcrumbs regardless of the filter settings.
Severity: LOW
Suggested Fix
Update the instrumentConsoleLambda function to apply the filters stored in the _filter set before calling triggerHandlers. The implementation should check if a console message matches any of the filters and, if so, prevent it from being captured.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: packages/node-core/src/integrations/console.ts#L42-L51
Potential issue: In Lambda environments, the `instrumentConsoleLambda` function is
registered to handle console instrumentation. This function unconditionally calls
`triggerHandlers` for every console message, ignoring any filters that have been
configured via `addConsoleInstrumentationFilter`. As a result, messages that are
intended to be filtered out, such as the `'[DEP0205] DeprecationWarning'`, are still
captured as breadcrumbs, leading to unnecessary noise in the telemetry data.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f73ad06. Configure here.
| /** Exported only for tests. */ | ||
| export const _nodeProfilingIntegration = ((): ProfilingIntegration<NodeClient> => { | ||
| if (![16, 18, 20, 22, 24].includes(NODE_MAJOR)) { | ||
| if (![16, 18, 20, 22, 24, 26].includes(NODE_MAJOR)) { |
There was a problem hiding this comment.
Profiling warning message omits Node 26 from supported list
Medium Severity
The version check on line 642 was updated to include 26 in the supported list (![16, 18, 20, 22, 24, 26].includes(NODE_MAJOR)), but the warning message on line 647 still says "16, 18, 20, 22, 24". Users on unsupported versions (e.g., Node 27) will see an incomplete list of supported versions, omitting that 26 is also supported.
Reviewed by Cursor Bugbot for commit f73ad06. Configure here.


This adds v26 to the node test matrix on CI, ensuring we support this properly.