Skip to content

Commit 497cfc1

Browse files
authored
Merge branch 'develop' into create-lowQualityTransactionsFilter-for-react-router
2 parents caf789a + 8f7599a commit 497cfc1

File tree

139 files changed

+3320
-1109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+3320
-1109
lines changed

.github/workflows/build.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ jobs:
475475
strategy:
476476
fail-fast: false
477477
matrix:
478-
node: [18, 20, 22]
478+
node: [18, 20, 22, '^24.0.1']
479479
steps:
480480
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
481481
uses: actions/checkout@v4
@@ -713,12 +713,12 @@ jobs:
713713
strategy:
714714
fail-fast: false
715715
matrix:
716-
node: ['18.20.5', 20, 22]
716+
node: ['18.20.5', 20, 22, 24]
717717
typescript:
718718
- false
719719
include:
720720
# Only check typescript for latest version (to streamline CI)
721-
- node: 22
721+
- node: 24
722722
typescript: '3.8'
723723
steps:
724724
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
@@ -760,7 +760,7 @@ jobs:
760760
strategy:
761761
fail-fast: false
762762
matrix:
763-
node: [18, 20, 22]
763+
node: [18, 20, 22, 24]
764764
steps:
765765
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
766766
uses: actions/checkout@v4

CHANGELOG.md

+47-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,38 @@
1010

1111
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
1212

13-
### Important Changes
13+
## 9.17.0
14+
15+
- feat(node): Migrate to `@fastify/otel` ([#15542](https://github.com/getsentry/sentry-javascript/pull/15542))
16+
17+
## 9.16.1
18+
19+
- fix(core): Make sure logs get flushed in server-runtime-client ([#16222](https://github.com/getsentry/sentry-javascript/pull/16222))
20+
- ref(node): Remove vercel flushing code that does nothing ([#16217](https://github.com/getsentry/sentry-javascript/pull/16217))
21+
22+
## 9.16.0
23+
24+
### Important changes
25+
26+
- **feat: Create a Vite plugin that injects sentryConfig into the global config ([#16197](https://github.com/getsentry/sentry-javascript/pull/16197))**
27+
28+
Add a new plugin `makeConfigInjectorPlugin` within our existing vite plugin that updates the global vite config with sentry options
29+
30+
- **feat(browser): Add option to sample linked traces consistently ([#16037](https://github.com/getsentry/sentry-javascript/pull/16037))**
31+
32+
This PR implements consistent sampling across traces as outlined in ([#15754](https://github.com/getsentry/sentry-javascript/pull/15754))
33+
34+
- **feat(cloudflare): Add support for durable objects ([#16180](https://github.com/getsentry/sentry-javascript/pull/16180))**
35+
36+
This PR introduces a new `instrumentDurableObjectWithSentry` method to the SDK, which instruments durable objects. We capture both traces and errors automatically.
37+
38+
- **feat(node): Add Prisma integration by default ([#16073](https://github.com/getsentry/sentry-javascript/pull/16073))**
39+
40+
[Prisma integration](https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/integrations/prisma/) is enabled by default, it should work for both ESM and CJS.
41+
42+
- **feat(react-router): Add client-side router instrumentation ([#16185](https://github.com/getsentry/sentry-javascript/pull/16185))**
43+
44+
Adds client-side instrumentation for react router's `HydratedRouter`. To enable it, simply replace `browserTracingIntegration()` with `reactRouterTracingIntegration()` in your client-side init call.
1445

1546
- **fix(node): Avoid double-wrapping http module ([#16177](https://github.com/getsentry/sentry-javascript/pull/16177))**
1647

@@ -32,6 +63,21 @@ ignoreOutgoingRequests(url: string, {
3263
})
3364
```
3465

66+
### Other changes
67+
68+
- feat(cloudflare): Add logs exports ([#16165](https://github.com/getsentry/sentry-javascript/pull/16165))
69+
- feat(vercel-edge): Add logs export ([#16166](https://github.com/getsentry/sentry-javascript/pull/16166))
70+
- feat(cloudflare): Read `SENTRY_RELEASE` from `env` ([#16201](https://github.com/getsentry/sentry-javascript/pull/16201))
71+
- feat(node): Drop `http.server` spans with 404 status by default ([#16205](https://github.com/getsentry/sentry-javascript/pull/16205))
72+
- fix(browser): Respect manually set sentry tracing headers in XHR requests ([#16184](https://github.com/getsentry/sentry-javascript/pull/16184))
73+
- fix(core): Respect manually set sentry tracing headers in fetch calls ([#16183](https://github.com/getsentry/sentry-javascript/pull/16183))
74+
- fix(feedback): Prevent `removeFromDom()` from throwing ([#16030](https://github.com/getsentry/sentry-javascript/pull/16030))
75+
- fix(node): Use class constructor in docstring for winston transport ([#16167](https://github.com/getsentry/sentry-javascript/pull/16167))
76+
- fix(node): Fix vercel flushing logic & add test for it ([#16208](https://github.com/getsentry/sentry-javascript/pull/16208))
77+
- fix(node): Fix 404 route handling in express 5 ([#16211](https://github.com/getsentry/sentry-javascript/pull/16211))
78+
- fix(logs): Ensure logs can be flushed correctly ([#16216](https://github.com/getsentry/sentry-javascript/pull/16216))
79+
- ref(core): Switch to standardized log envelope ([#16133](https://github.com/getsentry/sentry-javascript/pull/16133))
80+
3581
## 9.15.0
3682

3783
### Important Changes

dev-packages/browser-integration-tests/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/browser-integration-tests",
3-
"version": "9.15.0",
3+
"version": "9.17.0",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {
@@ -42,7 +42,7 @@
4242
"@babel/preset-typescript": "^7.16.7",
4343
"@playwright/test": "~1.50.0",
4444
"@sentry-internal/rrweb": "2.34.0",
45-
"@sentry/browser": "9.15.0",
45+
"@sentry/browser": "9.17.0",
4646
"@supabase/supabase-js": "2.49.3",
4747
"axios": "1.8.2",
4848
"babel-loader": "^8.2.2",

dev-packages/bundle-analyzer-scenarios/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/bundle-analyzer-scenarios",
3-
"version": "9.15.0",
3+
"version": "9.17.0",
44
"description": "Scenarios to test bundle analysis with",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/dev-packages/bundle-analyzer-scenarios",

dev-packages/clear-cache-gh-action/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@sentry-internal/clear-cache-gh-action",
33
"description": "An internal Github Action to clear GitHub caches.",
4-
"version": "9.15.0",
4+
"version": "9.17.0",
55
"license": "MIT",
66
"engines": {
77
"node": ">=18"

dev-packages/e2e-tests/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/e2e-tests",
3-
"version": "9.15.0",
3+
"version": "9.17.0",
44
"license": "MIT",
55
"private": true,
66
"scripts": {

dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts

+16-11
Original file line numberDiff line numberDiff line change
@@ -53,34 +53,39 @@ test('Sends an API route transaction', async ({ baseURL }) => {
5353
span_id: expect.stringMatching(/[a-f0-9]{16}/),
5454
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
5555
data: {
56-
'sentry.origin': 'manual',
57-
'fastify.type': 'middleware',
58-
'plugin.name': 'fastify -> @fastify/middie',
59-
'hook.name': 'onRequest',
56+
'sentry.origin': 'auto.http.otel.fastify',
57+
'sentry.op': 'hook.fastify',
58+
'service.name': 'fastify',
59+
'hook.name': 'fastify -> @fastify/otel -> @fastify/middie - onRequest',
60+
'fastify.type': 'hook',
61+
'hook.callback.name': 'runMiddie',
6062
},
61-
description: 'middleware - runMiddie',
63+
description: '@fastify/middie - onRequest',
64+
op: 'hook.fastify',
6265
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
6366
start_timestamp: expect.any(Number),
6467
timestamp: expect.any(Number),
6568
status: 'ok',
66-
origin: 'manual',
69+
origin: 'auto.http.otel.fastify',
6770
},
6871
{
6972
span_id: expect.stringMatching(/[a-f0-9]{16}/),
7073
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
7174
data: {
7275
'sentry.origin': 'auto.http.otel.fastify',
73-
'sentry.op': 'request_handler.fastify',
74-
'plugin.name': 'fastify -> @fastify/middie',
75-
'fastify.type': 'request_handler',
76+
'sentry.op': 'request-handler.fastify',
77+
'service.name': 'fastify',
78+
'hook.name': 'fastify -> @fastify/otel -> @fastify/middie - route-handler',
79+
'fastify.type': 'request-handler',
7680
'http.route': '/test-transaction',
81+
'hook.callback.name': 'anonymous',
7782
},
78-
description: '@fastify/middie',
83+
description: '@fastify/middie - route-handler',
84+
op: 'request-handler.fastify',
7985
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
8086
start_timestamp: expect.any(Number),
8187
timestamp: expect.any(Number),
8288
status: 'ok',
83-
op: 'request_handler.fastify',
8489
origin: 'auto.http.otel.fastify',
8590
},
8691
{

dev-packages/e2e-tests/test-applications/nextjs-14/tests/generation-functions.test.ts

-17
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,3 @@ test('Should send a transaction event with correct status for a generateMetadata
125125

126126
expect((await transactionPromise).contexts?.trace?.status).toBe('ok');
127127
});
128-
129-
test('Should send a transaction event with correct status for a generateMetadata() function invocation with notfound()', async ({
130-
page,
131-
}) => {
132-
const testTitle = 'notfound-foobar';
133-
134-
const transactionPromise = waitForTransaction('nextjs-14', async transactionEvent => {
135-
return (
136-
transactionEvent.contexts?.trace?.data?.['http.target'] ===
137-
`/generation-functions/with-notfound?metadataTitle=${testTitle}`
138-
);
139-
});
140-
141-
await page.goto(`/generation-functions/with-notfound?metadataTitle=${testTitle}`);
142-
143-
expect((await transactionPromise).contexts?.trace?.status).toBe('not_found');
144-
});

dev-packages/e2e-tests/test-applications/nextjs-app-dir/app/route-handlers/[param]/route.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ export async function GET() {
55
}
66

77
export async function POST() {
8-
return NextResponse.json({ name: 'John Doe' }, { status: 404 });
8+
return NextResponse.json({ name: 'John Doe' }, { status: 403 });
99
}

dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/route-handlers.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test('Should create a transaction for route handlers and correctly set span stat
2828

2929
const routehandlerTransaction = await routehandlerTransactionPromise;
3030

31-
expect(routehandlerTransaction.contexts?.trace?.status).toBe('not_found');
31+
expect(routehandlerTransaction.contexts?.trace?.status).toBe('permission_denied');
3232
expect(routehandlerTransaction.contexts?.trace?.op).toBe('http.server');
3333
});
3434

dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/server-components.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ test('Should set a "not_found" status on a server component span when notFound()
8080
op: 'function.nextjs',
8181
status: 'not_found',
8282
data: expect.objectContaining({
83-
'sentry.nextjs.function.type': 'Page',
84-
'sentry.nextjs.function.route': '/server-component/not-found',
83+
'sentry.nextjs.ssr.function.type': 'Page',
84+
'sentry.nextjs.ssr.function.route': '/server-component/not-found',
8585
}),
8686
}),
8787
);
@@ -112,8 +112,8 @@ test('Should capture an error and transaction for a app router page', async ({ p
112112
op: 'function.nextjs',
113113
status: 'internal_error',
114114
data: expect.objectContaining({
115-
'sentry.nextjs.function.type': 'Page',
116-
'sentry.nextjs.function.route': '/server-component/faulty',
115+
'sentry.nextjs.ssr.function.type': 'Page',
116+
'sentry.nextjs.ssr.function.route': '/server-component/faulty',
117117
}),
118118
}),
119119
);

dev-packages/e2e-tests/test-applications/node-connect/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"esModuleInterop": true,
55
"lib": ["dom", "dom.iterable", "esnext"],
66
"strict": true,
7-
"noEmit": true
7+
"noEmit": true,
8+
"skipLibCheck": true
89
},
910
"include": ["src/*.ts"]
1011
}

dev-packages/e2e-tests/test-applications/node-express-incorrect-instrumentation/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"esModuleInterop": true,
55
"lib": ["es2018"],
66
"strict": true,
7-
"outDir": "dist"
7+
"outDir": "dist",
8+
"skipLibCheck": true
89
},
910
"include": ["src/**/*.ts"]
1011
}

dev-packages/e2e-tests/test-applications/node-express-send-to-sentry/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"esModuleInterop": true,
55
"lib": ["es2018"],
66
"strict": true,
7-
"outDir": "dist"
7+
"outDir": "dist",
8+
"skipLibCheck": true
89
},
910
"include": ["src/**/*.ts"]
1011
}

dev-packages/e2e-tests/test-applications/node-express/src/app.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Sentry.init({
1313
debug: !!process.env.DEBUG,
1414
tunnel: `http://localhost:3031/`, // proxy server
1515
tracesSampleRate: 1,
16+
_experiments: {
17+
enableLogs: true,
18+
},
1619
});
1720

1821
import { TRPCError, initTRPC } from '@trpc/server';
@@ -30,6 +33,11 @@ app.get('/test-success', function (req, res) {
3033
res.send({ version: 'v1' });
3134
});
3235

36+
app.get('/test-log', function (req, res) {
37+
Sentry.logger.debug('Accessed /test-log route');
38+
res.send({ message: 'Log sent' });
39+
});
40+
3341
app.get('/test-param/:param', function (req, res) {
3442
res.send({ paramWas: req.params.param });
3543
});
@@ -123,8 +131,8 @@ export const appRouter = t.router({
123131
.mutation(() => {
124132
throw new Error('I crashed in a trpc handler');
125133
}),
126-
dontFindSomething: procedure.mutation(() => {
127-
throw new TRPCError({ code: 'NOT_FOUND', cause: new Error('Page not found') });
134+
unauthorized: procedure.mutation(() => {
135+
throw new TRPCError({ code: 'UNAUTHORIZED', cause: new Error('Unauthorized') });
128136
}),
129137
});
130138

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { expect, test } from '@playwright/test';
2+
import { waitForEnvelopeItem } from '@sentry-internal/test-utils';
3+
import type { SerializedLog, SerializedLogContainer } from '@sentry/core';
4+
5+
test('should send logs', async ({ baseURL }) => {
6+
const logEnvelopePromise = waitForEnvelopeItem('node-express', envelope => {
7+
return envelope[0].type === 'log' && (envelope[1] as SerializedLogContainer).items[0]?.level === 'debug';
8+
});
9+
10+
await fetch(`${baseURL}/test-log`);
11+
12+
const logEnvelope = await logEnvelopePromise;
13+
const log = (logEnvelope[1] as SerializedLogContainer).items[0];
14+
expect(log?.level).toBe('debug');
15+
expect(log?.body).toBe('Accessed /test-log route');
16+
});

dev-packages/e2e-tests/test-applications/node-express/tests/trpc.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ test('Should record transaction and error for a trpc handler that returns a stat
109109
const transactionEventPromise = waitForTransaction('node-express', transactionEvent => {
110110
return (
111111
transactionEvent.transaction === 'POST /trpc' &&
112-
!!transactionEvent.spans?.find(span => span.description === 'trpc/dontFindSomething')
112+
!!transactionEvent.spans?.find(span => span.description === 'trpc/unauthorized')
113113
);
114114
});
115115

116116
const errorEventPromise = waitForError('node-express', errorEvent => {
117-
return !!errorEvent?.exception?.values?.some(exception => exception.value?.includes('Page not found'));
117+
return !!errorEvent?.exception?.values?.some(exception => exception.value?.includes('Unauthorized'));
118118
});
119119

120120
const trpcClient = createTRPCProxyClient<AppRouter>({
@@ -125,7 +125,7 @@ test('Should record transaction and error for a trpc handler that returns a stat
125125
],
126126
});
127127

128-
await expect(trpcClient.dontFindSomething.mutate()).rejects.toBeDefined();
128+
await expect(trpcClient.unauthorized.mutate()).rejects.toBeDefined();
129129

130130
await expect(transactionEventPromise).resolves.toBeDefined();
131131
await expect(errorEventPromise).resolves.toBeDefined();

dev-packages/e2e-tests/test-applications/node-fastify/package.json renamed to dev-packages/e2e-tests/test-applications/node-fastify-3/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "node-fastify",
2+
"name": "node-fastify-3",
33
"version": "1.0.0",
44
"private": true,
55
"scripts": {
@@ -15,7 +15,7 @@
1515
"@sentry/core": "latest || *",
1616
"@sentry/opentelemetry": "latest || *",
1717
"@types/node": "^18.19.1",
18-
"fastify": "4.23.2",
18+
"fastify": "3.29.5",
1919
"typescript": "~5.0.0",
2020
"ts-node": "10.9.1"
2121
},

0 commit comments

Comments
 (0)