Skip to content

Commit 87d04c4

Browse files
authored
Merge branch 'develop' into timfish/feat/node-propagateTraceparent
2 parents b0c4b09 + 6f0b8b4 commit 87d04c4

File tree

28 files changed

+2334
-227
lines changed

28 files changed

+2334
-227
lines changed

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ module.exports = [
240240
import: createImport('init'),
241241
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
242242
gzip: true,
243-
limit: '161 KB',
243+
limit: '162 KB',
244244
},
245245
{
246246
name: '@sentry/node - without tracing',

dev-packages/e2e-tests/test-applications/cloudflare-mcp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test:dev": "TEST_ENV=development playwright test"
1616
},
1717
"dependencies": {
18-
"@modelcontextprotocol/sdk": "^1.22.0",
18+
"@modelcontextprotocol/sdk": "1.24.0",
1919
"@sentry/cloudflare": "latest || *",
2020
"agents": "^0.2.23",
2121
"zod": "^3.25.76"

dev-packages/e2e-tests/test-applications/nextjs-16/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@sentry/core": "latest || *",
2828
"ai": "^3.0.0",
2929
"import-in-the-middle": "^2",
30-
"next": "16.0.9",
30+
"next": "16.0.10",
3131
"react": "19.1.0",
3232
"react-dom": "19.1.0",
3333
"require-in-the-middle": "^8",

dev-packages/e2e-tests/test-applications/nextjs-orpc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@sentry/nextjs": "latest || *",
2020
"@orpc/server": "latest",
2121
"@orpc/client": "latest",
22-
"next": "14.2.32",
22+
"next": "14.2.35",
2323
"react": "18.3.1",
2424
"react-dom": "18.3.1",
2525
"server-only": "^0.0.1"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const Sentry = require('@sentry/node');
2+
const { loggingTransport } = require('@sentry-internal/node-integration-tests');
3+
4+
Sentry.init({
5+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
6+
release: '1.0',
7+
tracesSampleRate: 1.0,
8+
transport: loggingTransport,
9+
integrations: [
10+
Sentry.postgresJsIntegration({
11+
requestHook: (span, sanitizedSqlQuery, connectionContext) => {
12+
// Add custom attributes to demonstrate requestHook functionality
13+
span.setAttribute('custom.requestHook', 'called');
14+
15+
// Set context information as extras for test validation
16+
Sentry.setExtra('requestHookCalled', {
17+
sanitizedQuery: sanitizedSqlQuery,
18+
database: connectionContext?.ATTR_DB_NAMESPACE,
19+
host: connectionContext?.ATTR_SERVER_ADDRESS,
20+
port: connectionContext?.ATTR_SERVER_PORT,
21+
});
22+
},
23+
}),
24+
],
25+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import * as Sentry from '@sentry/node';
2+
import { loggingTransport } from '@sentry-internal/node-integration-tests';
3+
4+
Sentry.init({
5+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
6+
release: '1.0',
7+
tracesSampleRate: 1.0,
8+
transport: loggingTransport,
9+
integrations: [
10+
Sentry.postgresJsIntegration({
11+
requestHook: (span, sanitizedSqlQuery, connectionContext) => {
12+
// Add custom attributes to demonstrate requestHook functionality
13+
span.setAttribute('custom.requestHook', 'called');
14+
15+
// Set context information as extras for test validation
16+
Sentry.setExtra('requestHookCalled', {
17+
sanitizedQuery: sanitizedSqlQuery,
18+
database: connectionContext?.ATTR_DB_NAMESPACE,
19+
host: connectionContext?.ATTR_SERVER_ADDRESS,
20+
port: connectionContext?.ATTR_SERVER_PORT,
21+
});
22+
},
23+
}),
24+
],
25+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const Sentry = require('@sentry/node');
2+
const { loggingTransport } = require('@sentry-internal/node-integration-tests');
3+
4+
Sentry.init({
5+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
6+
release: '1.0',
7+
tracesSampleRate: 1.0,
8+
transport: loggingTransport,
9+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as Sentry from '@sentry/node';
2+
import { loggingTransport } from '@sentry-internal/node-integration-tests';
3+
4+
Sentry.init({
5+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
6+
release: '1.0',
7+
tracesSampleRate: 1.0,
8+
transport: loggingTransport,
9+
});
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
const Sentry = require('@sentry/node');
2+
const postgres = require('postgres');
3+
4+
// Stop the process from exiting before the transaction is sent
5+
setInterval(() => {}, 1000);
6+
7+
const sql = postgres({ port: 5444, user: 'test', password: 'test', database: 'test_db' });
8+
9+
async function run() {
10+
await Sentry.startSpan(
11+
{
12+
name: 'Test Transaction',
13+
op: 'transaction',
14+
},
15+
async () => {
16+
try {
17+
await sql`
18+
CREATE TABLE "User" ("id" SERIAL NOT NULL,"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"email" TEXT NOT NULL,"name" TEXT,CONSTRAINT "User_pkey" PRIMARY KEY ("id"));
19+
`;
20+
21+
await sql`
22+
INSERT INTO "User" ("email", "name") VALUES ('Foo', 'bar@baz.com');
23+
`;
24+
25+
await sql`
26+
SELECT * FROM "User" WHERE "email" = 'bar@baz.com';
27+
`;
28+
29+
await sql`
30+
DROP TABLE "User";
31+
`;
32+
} finally {
33+
await sql.end();
34+
}
35+
},
36+
);
37+
}
38+
39+
run();
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import * as Sentry from '@sentry/node';
2+
import postgres from 'postgres';
3+
4+
// Stop the process from exiting before the transaction is sent
5+
setInterval(() => {}, 1000);
6+
7+
const sql = postgres({ port: 5444, user: 'test', password: 'test', database: 'test_db' });
8+
9+
async function run() {
10+
await Sentry.startSpan(
11+
{
12+
name: 'Test Transaction',
13+
op: 'transaction',
14+
},
15+
async () => {
16+
try {
17+
await sql`
18+
CREATE TABLE "User" ("id" SERIAL NOT NULL,"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"email" TEXT NOT NULL,"name" TEXT,CONSTRAINT "User_pkey" PRIMARY KEY ("id"));
19+
`;
20+
21+
await sql`
22+
INSERT INTO "User" ("email", "name") VALUES ('Foo', 'bar@baz.com');
23+
`;
24+
25+
await sql`
26+
SELECT * FROM "User" WHERE "email" = 'bar@baz.com';
27+
`;
28+
29+
await sql`
30+
DROP TABLE "User";
31+
`;
32+
} finally {
33+
await sql.end();
34+
}
35+
},
36+
);
37+
}
38+
39+
run();

0 commit comments

Comments
 (0)