Skip to content

Commit ed8602c

Browse files
mydeaJPeer264
andauthored
feat(node): Support Node 26 (#20710)
This adds v26 to the node test matrix on CI, ensuring we support this properly. --------- Co-authored-by: JPeer264 <jan.peer@sentry.io>
1 parent 43a4bff commit ed8602c

12 files changed

Lines changed: 118 additions & 96 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ jobs:
554554
strategy:
555555
fail-fast: false
556556
matrix:
557-
node: [18, 20, 22, 24]
557+
node: [18, 20, 22, 24, 26]
558558
steps:
559559
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
560560
uses: actions/checkout@v6
@@ -810,7 +810,7 @@ jobs:
810810
strategy:
811811
fail-fast: false
812812
matrix:
813-
node: [18, 20, 22, 24]
813+
node: [18, 20, 22, 24, 26]
814814
typescript:
815815
- false
816816
include:
@@ -851,7 +851,7 @@ jobs:
851851
strategy:
852852
fail-fast: false
853853
matrix:
854-
node: [18, 20, 22, 24]
854+
node: [18, 20, 22, 24, 26]
855855
typescript:
856856
- false
857857
include:
@@ -939,7 +939,7 @@ jobs:
939939
strategy:
940940
fail-fast: false
941941
matrix:
942-
node: [18, 20, 22, 24]
942+
node: [18, 20, 22, 24, 26]
943943
steps:
944944
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
945945
uses: actions/checkout@v6

dev-packages/node-core-integration-tests/utils/runner.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,8 @@ export function createRunner(...paths: string[]) {
486486

487487
if (process.env.DEBUG) log('stderr line', output);
488488

489-
if (ensureNoErrorOutput) {
489+
// Ignore deprecation warnings for this purpose
490+
if (ensureNoErrorOutput && !`${output}`.includes('DeprecationWarning:')) {
490491
complete(new Error(`Expected no error output but got: '${output}'`));
491492
}
492493
});

dev-packages/node-integration-tests/suites/integrations/console/filter/test.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('Console Integration', () => {
88

99
createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createRunner, test) => {
1010
test('filters console messages', async () => {
11-
await createRunner()
11+
const runner = createRunner()
1212
.expect({
1313
event: {
1414
exception: {
@@ -28,8 +28,17 @@ describe('Console Integration', () => {
2828
],
2929
},
3030
})
31-
.start()
32-
.completed();
31+
.start();
32+
33+
await runner.completed();
34+
35+
expect(runner.getLogs()).toContainEqual('hello');
36+
expect(runner.getLogs()).toContainEqual('baz');
37+
expect(runner.getLogs()).not.toContainEqual('foo');
38+
expect(runner.getLogs()).not.toContainEqual('foo2');
39+
40+
// Ensure deprecation warnigns are not included
41+
expect(runner.getLogs()).not.toContainEqual(expect.stringMatching('DeprecationWarning'));
3342
});
3443
});
3544
});

dev-packages/node-integration-tests/suites/tracing/postgres/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"author": "",
1111
"license": "ISC",
1212
"dependencies": {
13-
"pg": "8.16.0",
14-
"pg-native": "3.5.0"
13+
"pg": "8.20.0",
14+
"pg-native": "3.7.0"
1515
}
1616
}

dev-packages/node-integration-tests/suites/tracing/postgres/test.ts

Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { describe, expect, test } from 'vitest';
22
import { createRunner } from '../../../utils/runner';
3+
import { conditionalTest } from '../../../utils';
34

45
describe('postgres auto instrumentation', () => {
56
test('should auto-instrument `pg` package', { timeout: 90_000 }, async () => {
@@ -49,7 +50,6 @@ describe('postgres auto instrumentation', () => {
4950
await createRunner(__dirname, 'scenario.js')
5051
.withDockerCompose({
5152
workingDirectory: [__dirname],
52-
setupCommand: 'yarn',
5353
})
5454
.expect({ transaction: EXPECTED_TRANSACTION })
5555
.start()
@@ -60,7 +60,6 @@ describe('postgres auto instrumentation', () => {
6060
await createRunner(__dirname, 'scenario-ignoreConnect.js')
6161
.withDockerCompose({
6262
workingDirectory: [__dirname],
63-
setupCommand: 'yarn',
6463
})
6564
.expect({
6665
transaction: txn => {
@@ -103,57 +102,59 @@ describe('postgres auto instrumentation', () => {
103102
.completed();
104103
});
105104

106-
test('should auto-instrument `pg-native` package', { timeout: 90_000 }, async () => {
107-
const EXPECTED_TRANSACTION = {
108-
transaction: 'Test Transaction',
109-
spans: expect.arrayContaining([
110-
expect.objectContaining({
111-
data: expect.objectContaining({
112-
'db.system': 'postgresql',
113-
'db.name': 'tests',
114-
'sentry.origin': 'manual',
115-
'sentry.op': 'db',
105+
conditionalTest({ max: 25 })('pg-native', () => {
106+
test('should auto-instrument `pg-native` package', { timeout: 90_000 }, async () => {
107+
const EXPECTED_TRANSACTION = {
108+
transaction: 'Test Transaction',
109+
spans: expect.arrayContaining([
110+
expect.objectContaining({
111+
data: expect.objectContaining({
112+
'db.system': 'postgresql',
113+
'db.name': 'tests',
114+
'sentry.origin': 'manual',
115+
'sentry.op': 'db',
116+
}),
117+
description: 'pg.connect',
118+
op: 'db',
119+
status: 'ok',
116120
}),
117-
description: 'pg.connect',
118-
op: 'db',
119-
status: 'ok',
120-
}),
121-
expect.objectContaining({
122-
data: expect.objectContaining({
123-
'db.system': 'postgresql',
124-
'db.name': 'tests',
125-
'db.statement': 'INSERT INTO "NativeUser" ("email", "name") VALUES ($1, $2)',
126-
'sentry.origin': 'auto.db.otel.postgres',
127-
'sentry.op': 'db',
121+
expect.objectContaining({
122+
data: expect.objectContaining({
123+
'db.system': 'postgresql',
124+
'db.name': 'tests',
125+
'db.statement': 'INSERT INTO "NativeUser" ("email", "name") VALUES ($1, $2)',
126+
'sentry.origin': 'auto.db.otel.postgres',
127+
'sentry.op': 'db',
128+
}),
129+
description: 'INSERT INTO "NativeUser" ("email", "name") VALUES ($1, $2)',
130+
op: 'db',
131+
status: 'ok',
132+
origin: 'auto.db.otel.postgres',
128133
}),
129-
description: 'INSERT INTO "NativeUser" ("email", "name") VALUES ($1, $2)',
130-
op: 'db',
131-
status: 'ok',
132-
origin: 'auto.db.otel.postgres',
133-
}),
134-
expect.objectContaining({
135-
data: expect.objectContaining({
136-
'db.system': 'postgresql',
137-
'db.name': 'tests',
138-
'db.statement': 'SELECT * FROM "NativeUser"',
139-
'sentry.origin': 'auto.db.otel.postgres',
140-
'sentry.op': 'db',
134+
expect.objectContaining({
135+
data: expect.objectContaining({
136+
'db.system': 'postgresql',
137+
'db.name': 'tests',
138+
'db.statement': 'SELECT * FROM "NativeUser"',
139+
'sentry.origin': 'auto.db.otel.postgres',
140+
'sentry.op': 'db',
141+
}),
142+
description: 'SELECT * FROM "NativeUser"',
143+
op: 'db',
144+
status: 'ok',
145+
origin: 'auto.db.otel.postgres',
141146
}),
142-
description: 'SELECT * FROM "NativeUser"',
143-
op: 'db',
144-
status: 'ok',
145-
origin: 'auto.db.otel.postgres',
146-
}),
147-
]),
148-
};
147+
]),
148+
};
149149

150-
await createRunner(__dirname, 'scenario-native.js')
151-
.withDockerCompose({
152-
workingDirectory: [__dirname],
153-
setupCommand: 'yarn',
154-
})
155-
.expect({ transaction: EXPECTED_TRANSACTION })
156-
.start()
157-
.completed();
150+
await createRunner(__dirname, 'scenario-native.js')
151+
.withDockerCompose({
152+
workingDirectory: [__dirname],
153+
setupCommand: 'yarn',
154+
})
155+
.expect({ transaction: EXPECTED_TRANSACTION })
156+
.start()
157+
.completed();
158+
});
158159
});
159160
});

dev-packages/node-integration-tests/suites/tracing/postgres/yarn.lock

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,38 @@ nan@~2.22.2:
2727
resolved "https://registry.yarnpkg.com/nan/-/nan-2.22.2.tgz#6b504fd029fb8f38c0990e52ad5c26772fdacfbb"
2828
integrity sha512-DANghxFkS1plDdRsX0X9pm0Z6SJNN6gBdtXfanwoZ8hooC5gosGFSBGRYHUVPz1asKA/kMRqDRdHrluZ61SpBQ==
2929

30-
pg-cloudflare@^1.2.5:
31-
version "1.2.5"
32-
resolved "https://registry.yarnpkg.com/pg-cloudflare/-/pg-cloudflare-1.2.5.tgz#2e3649c38a7a9c74a7e5327c8098a2fd9af595bd"
33-
integrity sha512-OOX22Vt0vOSRrdoUPKJ8Wi2OpE/o/h9T8X1s4qSkCedbNah9ei2W2765be8iMVxQUsvgT7zIAT2eIa9fs5+vtg==
30+
pg-cloudflare@^1.3.0:
31+
version "1.3.0"
32+
resolved "https://registry.yarnpkg.com/pg-cloudflare/-/pg-cloudflare-1.3.0.tgz#386035d4bfcf1a7045b026f8b21acf5353f14d65"
33+
integrity sha512-6lswVVSztmHiRtD6I8hw4qP/nDm1EJbKMRhf3HCYaqud7frGysPv7FYJ5noZQdhQtN2xJnimfMtvQq21pdbzyQ==
3434

35-
pg-connection-string@^2.9.0:
36-
version "2.9.0"
37-
resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.9.0.tgz#f75e06591fdd42ec7636fe2c6a03febeedbec9bf"
38-
integrity sha512-P2DEBKuvh5RClafLngkAuGe9OUlFV7ebu8w1kmaaOgPcpJd1RIFh7otETfI6hAR8YupOLFTY7nuvvIn7PLciUQ==
35+
pg-connection-string@^2.12.0:
36+
version "2.12.0"
37+
resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.12.0.tgz#4084f917902bb2daae3dc1376fe24ac7b4eaccf2"
38+
integrity sha512-U7qg+bpswf3Cs5xLzRqbXbQl85ng0mfSV/J0nnA31MCLgvEaAo7CIhmeyrmJpOr7o+zm0rXK+hNnT5l9RHkCkQ==
3939

4040
pg-int8@1.0.1:
4141
version "1.0.1"
4242
resolved "https://registry.yarnpkg.com/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c"
4343
integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==
4444

45-
pg-native@3.5.0:
46-
version "3.5.0"
47-
resolved "https://registry.yarnpkg.com/pg-native/-/pg-native-3.5.0.tgz#1a43c0d5f5744e40df3bf737c43178ce98984255"
48-
integrity sha512-rj4LYouevTdKxvRLnvtOLEPOerkiPAqUdZE1K48IfQluEH/x7GrldEDdSaEOmJ6z7s6LQwDTpAPhm2s00iG8xw==
45+
pg-native@3.7.0:
46+
version "3.7.0"
47+
resolved "https://registry.yarnpkg.com/pg-native/-/pg-native-3.7.0.tgz#1bd78031482c78dc5240c4350cddb291493dc34f"
48+
integrity sha512-q2V5DynvPt4PD75q1DqZOUrieEgE4bf/flEeLCzzs8axgn8x2mRCUhd1DP0cqMz8FEdpVEDb0/zKblQWeijbGg==
4949
dependencies:
5050
libpq "^1.8.15"
5151
pg-types "2.2.0"
5252

53-
pg-pool@^3.10.0:
54-
version "3.10.0"
55-
resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-3.10.0.tgz#134b0213755c5e7135152976488aa7cd7ee1268d"
56-
integrity sha512-DzZ26On4sQ0KmqnO34muPcmKbhrjmyiO4lCCR0VwEd7MjmiKf5NTg/6+apUEu0NF7ESa37CGzFxH513CoUmWnA==
53+
pg-pool@^3.13.0:
54+
version "3.13.0"
55+
resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-3.13.0.tgz#416482e9700e8f80c685a6ae5681697a413c13a3"
56+
integrity sha512-gB+R+Xud1gLFuRD/QgOIgGOBE2KCQPaPwkzBBGC9oG69pHTkhQeIuejVIk3/cnDyX39av2AxomQiyPT13WKHQA==
5757

58-
pg-protocol@^1.10.0:
59-
version "1.10.0"
60-
resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.10.0.tgz#a473afcbb1c6e5dc3ac24869ba3dd563f8a1ae1b"
61-
integrity sha512-IpdytjudNuLv8nhlHs/UrVBhU0e78J0oIS/0AVdTbWxSOkFUVdsHC/NrorO6nXsQNDTT1kzDSOMJubBQviX18Q==
58+
pg-protocol@^1.13.0:
59+
version "1.13.0"
60+
resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.13.0.tgz#fdaf6d020bca590d58bb991b4b16fc448efe0511"
61+
integrity sha512-zzdvXfS6v89r6v7OcFCHfHlyG/wvry1ALxZo4LqgUoy7W9xhBDMaqOuMiF3qEV45VqsN6rdlcehHrfDtlCPc8w==
6262

6363
pg-types@2.2.0:
6464
version "2.2.0"
@@ -71,18 +71,18 @@ pg-types@2.2.0:
7171
postgres-date "~1.0.4"
7272
postgres-interval "^1.1.0"
7373

74-
pg@8.16.0:
75-
version "8.16.0"
76-
resolved "https://registry.yarnpkg.com/pg/-/pg-8.16.0.tgz#40b08eedb5eb1834252cf3e3629503e32e6c6c04"
77-
integrity sha512-7SKfdvP8CTNXjMUzfcVTaI+TDzBEeaUnVwiVGZQD1Hh33Kpev7liQba9uLd4CfN8r9mCVsD0JIpq03+Unpz+kg==
74+
pg@8.20.0:
75+
version "8.20.0"
76+
resolved "https://registry.yarnpkg.com/pg/-/pg-8.20.0.tgz#1a274de944cb329fd6dd77a6d371a005ba6b136d"
77+
integrity sha512-ldhMxz2r8fl/6QkXnBD3CR9/xg694oT6DZQ2s6c/RI28OjtSOpxnPrUCGOBJ46RCUxcWdx3p6kw/xnDHjKvaRA==
7878
dependencies:
79-
pg-connection-string "^2.9.0"
80-
pg-pool "^3.10.0"
81-
pg-protocol "^1.10.0"
79+
pg-connection-string "^2.12.0"
80+
pg-pool "^3.13.0"
81+
pg-protocol "^1.13.0"
8282
pg-types "2.2.0"
8383
pgpass "1.0.5"
8484
optionalDependencies:
85-
pg-cloudflare "^1.2.5"
85+
pg-cloudflare "^1.3.0"
8686

8787
pgpass@1.0.5:
8888
version "1.0.5"

dev-packages/node-integration-tests/utils/runner.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,8 @@ export function createRunner(...paths: string[]) {
602602

603603
if (process.env.DEBUG) log('stderr line', output);
604604

605-
if (ensureNoErrorOutput) {
605+
// Ignore deprecation warnings for this purpose
606+
if (ensureNoErrorOutput && !`${output}`.includes('DeprecationWarning:')) {
606607
complete(new Error(`Expected no error output but got: '${output}'`));
607608
}
608609
});

packages/node-core/src/integrations/console.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ export const consoleIntegration = defineIntegration((options: Partial<ConsoleInt
3939
}
4040

4141
// Delegate breadcrumb handling to the core console integration.
42-
const core = coreConsoleIntegration(options);
42+
const core = coreConsoleIntegration({
43+
...options,
44+
filter: [
45+
...(options.filter || []),
46+
// Deprecation on Node 26 for module.require(), which is used by IITM
47+
'[DEP0205] DeprecationWarning',
48+
],
49+
});
4350
core.setup?.(client);
4451
},
4552
};

packages/node-native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"build:tarball": "npm pack"
6363
},
6464
"dependencies": {
65-
"@sentry-internal/node-native-stacktrace": "^0.4.0",
65+
"@sentry-internal/node-native-stacktrace": "^0.5.0",
6666
"@sentry/core": "10.52.0",
6767
"@sentry/node": "10.52.0"
6868
},

packages/profiling-node/scripts/prune-profiler-binaries.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ const NODE_TO_ABI = {
6868
20: '115',
6969
22: '127',
7070
24: '137',
71+
26: '147',
7172
};
7273

7374
if (NODE) {
@@ -83,6 +84,8 @@ if (NODE) {
8384
NODE = NODE_TO_ABI['22'];
8485
} else if (NODE.startsWith('24')) {
8586
NODE = NODE_TO_ABI['24'];
87+
} else if (NODE.startsWith('26')) {
88+
NODE = NODE_TO_ABI['26'];
8689
} else {
8790
ARGV_ERRORS.push(
8891
`❌ Sentry: Invalid node version passed as argument, please make sure --target_node is a valid major node version. Supported versions are ${Object.keys(

0 commit comments

Comments
 (0)