Skip to content

Commit 8802799

Browse files
authored
Merge pull request getsentry#12675 from getsentry/prepare-release/8.13.0
meta(changelog): Update changelog for 8.13.0
2 parents 7e29803 + e0f995f commit 8802799

File tree

137 files changed

+1499
-714
lines changed

Some content is hidden

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

137 files changed

+1499
-714
lines changed

.craft.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ targets:
9797
- name: npm
9898
id: '@sentry/bun'
9999
includeNames: /^sentry-bun-\d.*\.tgz$/
100+
- name: npm
101+
id: '@sentry/nestjs'
102+
includeNames: /^sentry-nestjs-\d.*\.tgz$/
100103

101104
## 6. Fullstack/Meta Frameworks (depending on Node and Browser or Framework SDKs)
102105
- name: npm

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ jobs:
10671067
'generic-ts3.8',
10681068
'node-fastify',
10691069
'node-hapi',
1070-
'node-nestjs',
1070+
'nestjs',
10711071
'node-exports-test-app',
10721072
'node-koa',
10731073
'node-connect',

.size-limit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ module.exports = [
211211
import: createImport('init'),
212212
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
213213
gzip: true,
214-
limit: '135 KB',
214+
limit: '140 KB',
215215
},
216216
{
217217
name: '@sentry/node - without tracing',
@@ -237,7 +237,7 @@ module.exports = [
237237
import: createImport('init'),
238238
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
239239
gzip: true,
240-
limit: '125 KB',
240+
limit: '130 KB',
241241
},
242242
];
243243

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44

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

7+
## 8.13.0
8+
9+
### Important Changes
10+
11+
- **feat(nestjs): Add Nest SDK** This release adds a dedicated SDK for [NestJS](https://nestjs.com/) (`@sentry/nestjs`)
12+
in alpha state. The SDK is a drop-in replacement for the Sentry Node SDK (`@sentry/node`) supporting the same set of
13+
features. See the [docs](https://docs.sentry.io/platforms/javascript/guides/nestjs/) for how to use the SDK.
14+
15+
### Other Changes
16+
17+
- deps: Bump bundler plugins to `2.20.1` (#12641)
18+
- deps(nextjs): Remove react peer dep and allow rc (#12670)
19+
- feat: Update OTEL deps (#12635)
20+
- feat(deps): bump @prisma/instrumentation from 5.15.0 to 5.15.1 (#12627)
21+
- feat(node): Add context info for missing instrumentation (#12639)
22+
- fix(feedback): Improve feedback error message (#12647)
23+
724
## 8.12.0
825

926
### Important Changes

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,11 @@ Our program is currently running on an invitation basis. If you're interested in
118118
to [email protected] and tell us, that you are interested in auditing this repository.
119119

120120
For more details, please have a look at https://sentry.io/security/#vulnerability-disclosure.
121+
122+
## Contributors
123+
124+
Thanks to everyone who contributed to the Sentry JavaScript SDK!
125+
126+
<a href="https://github.com/getsentry/sentry-javascript/graphs/contributors">
127+
<img src="https://contributors-img.web.app/image?repo=getsentry/sentry-javascript" />
128+
</a>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "node-nestjs",
2+
"name": "nestjs",
33
"version": "0.0.1",
44
"private": true,
55
"scripts": {
@@ -18,7 +18,7 @@
1818
"@nestjs/common": "^10.0.0",
1919
"@nestjs/core": "^10.0.0",
2020
"@nestjs/platform-express": "^10.0.0",
21-
"@sentry/node": "latest || *",
21+
"@sentry/nestjs": "latest || *",
2222
"@sentry/types": "latest || *",
2323
"reflect-metadata": "^0.2.0",
2424
"rxjs": "^7.8.1"

dev-packages/e2e-tests/test-applications/node-nestjs/src/app.service.ts renamed to dev-packages/e2e-tests/test-applications/nestjs/src/app.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Injectable } from '@nestjs/common';
2-
import * as Sentry from '@sentry/node';
2+
import * as Sentry from '@sentry/nestjs';
33
import { makeHttpRequest } from './utils';
44

55
@Injectable()

dev-packages/e2e-tests/test-applications/node-nestjs/src/instrument.ts renamed to dev-packages/e2e-tests/test-applications/nestjs/src/instrument.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Sentry from '@sentry/node';
1+
import * as Sentry from '@sentry/nestjs';
22

33
Sentry.init({
44
environment: 'qa', // dynamic sampling bias to keep transactions

dev-packages/e2e-tests/test-applications/node-nestjs/src/main.ts renamed to dev-packages/e2e-tests/test-applications/nestjs/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import './instrument';
33

44
// Import other modules
55
import { BaseExceptionFilter, HttpAdapterHost, NestFactory } from '@nestjs/core';
6-
import * as Sentry from '@sentry/node';
6+
import * as Sentry from '@sentry/nestjs';
77
import { AppModule1, AppModule2 } from './app.module';
88

99
const app1Port = 3030;

dev-packages/e2e-tests/test-applications/node-nestjs/start-event-proxy.mjs renamed to dev-packages/e2e-tests/test-applications/nestjs/start-event-proxy.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { startEventProxyServer } from '@sentry-internal/test-utils';
22

33
startEventProxyServer({
44
port: 3031,
5-
proxyServerName: 'node-nestjs',
5+
proxyServerName: 'nestjs',
66
});

dev-packages/e2e-tests/test-applications/node-nestjs/tests/errors.test.ts renamed to dev-packages/e2e-tests/test-applications/nestjs/tests/errors.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test';
22
import { waitForError } from '@sentry-internal/test-utils';
33

44
test('Sends exception to Sentry', async ({ baseURL }) => {
5-
const errorEventPromise = waitForError('node-nestjs', event => {
5+
const errorEventPromise = waitForError('nestjs', event => {
66
return !event.type && event.exception?.values?.[0]?.value === 'This is an exception with id 123';
77
});
88

dev-packages/e2e-tests/test-applications/node-nestjs/tests/propagation.test.ts renamed to dev-packages/e2e-tests/test-applications/nestjs/tests/propagation.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import { SpanJSON } from '@sentry/types';
66
test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
77
const id = crypto.randomUUID();
88

9-
const inboundTransactionPromise = waitForTransaction('node-nestjs', transactionEvent => {
9+
const inboundTransactionPromise = waitForTransaction('nestjs', transactionEvent => {
1010
return (
1111
transactionEvent.contexts?.trace?.op === 'http.server' &&
1212
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}`
1313
);
1414
});
1515

16-
const outboundTransactionPromise = waitForTransaction('node-nestjs', transactionEvent => {
16+
const outboundTransactionPromise = waitForTransaction('nestjs', transactionEvent => {
1717
return (
1818
transactionEvent.contexts?.trace?.op === 'http.server' &&
1919
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http/${id}`
@@ -121,14 +121,14 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
121121
test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
122122
const id = crypto.randomUUID();
123123

124-
const inboundTransactionPromise = waitForTransaction('node-nestjs', transactionEvent => {
124+
const inboundTransactionPromise = waitForTransaction('nestjs', transactionEvent => {
125125
return (
126126
transactionEvent?.contexts?.trace?.op === 'http.server' &&
127127
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}`
128128
);
129129
});
130130

131-
const outboundTransactionPromise = waitForTransaction('node-nestjs', transactionEvent => {
131+
const outboundTransactionPromise = waitForTransaction('nestjs', transactionEvent => {
132132
return (
133133
transactionEvent?.contexts?.trace?.op === 'http.server' &&
134134
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch/${id}`
@@ -234,7 +234,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
234234
});
235235

236236
test('Propagates trace for outgoing external http requests', async ({ baseURL }) => {
237-
const inboundTransactionPromise = waitForTransaction('node-nestjs', transactionEvent => {
237+
const inboundTransactionPromise = waitForTransaction('nestjs', transactionEvent => {
238238
return (
239239
transactionEvent?.contexts?.trace?.op === 'http.server' &&
240240
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-allowed`
@@ -271,7 +271,7 @@ test('Propagates trace for outgoing external http requests', async ({ baseURL })
271271
});
272272

273273
test('Does not propagate outgoing http requests not covered by tracePropagationTargets', async ({ baseURL }) => {
274-
const inboundTransactionPromise = waitForTransaction('node-nestjs', transactionEvent => {
274+
const inboundTransactionPromise = waitForTransaction('nestjs', transactionEvent => {
275275
return (
276276
transactionEvent?.contexts?.trace?.op === 'http.server' &&
277277
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-disallowed`
@@ -295,7 +295,7 @@ test('Does not propagate outgoing http requests not covered by tracePropagationT
295295
});
296296

297297
test('Propagates trace for outgoing external fetch requests', async ({ baseURL }) => {
298-
const inboundTransactionPromise = waitForTransaction('node-nestjs', transactionEvent => {
298+
const inboundTransactionPromise = waitForTransaction('nestjs', transactionEvent => {
299299
return (
300300
transactionEvent?.contexts?.trace?.op === 'http.server' &&
301301
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-allowed`
@@ -332,7 +332,7 @@ test('Propagates trace for outgoing external fetch requests', async ({ baseURL }
332332
});
333333

334334
test('Does not propagate outgoing fetch requests not covered by tracePropagationTargets', async ({ baseURL }) => {
335-
const inboundTransactionPromise = waitForTransaction('node-nestjs', transactionEvent => {
335+
const inboundTransactionPromise = waitForTransaction('nestjs', transactionEvent => {
336336
return (
337337
transactionEvent?.contexts?.trace?.op === 'http.server' &&
338338
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-disallowed`

dev-packages/e2e-tests/test-applications/node-nestjs/tests/transactions.test.ts renamed to dev-packages/e2e-tests/test-applications/nestjs/tests/transactions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test';
22
import { waitForTransaction } from '@sentry-internal/test-utils';
33

44
test('Sends an API route transaction', async ({ baseURL }) => {
5-
const pageloadTransactionEventPromise = waitForTransaction('node-nestjs', transactionEvent => {
5+
const pageloadTransactionEventPromise = waitForTransaction('nestjs', transactionEvent => {
66
return (
77
transactionEvent?.contexts?.trace?.op === 'http.server' &&
88
transactionEvent?.transaction === 'GET /test-transaction'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@sentry:registry=http://127.0.0.1:4873
2+
@sentry-internal:registry=http://127.0.0.1:4873
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "node-express-incorrect-instrumentation",
3+
"version": "1.0.0",
4+
"private": true,
5+
"scripts": {
6+
"build": "tsc",
7+
"start": "node dist/app.js",
8+
"test": "playwright test",
9+
"clean": "npx rimraf node_modules pnpm-lock.yaml",
10+
"test:build": "pnpm install && pnpm build",
11+
"test:assert": "pnpm test"
12+
},
13+
"dependencies": {
14+
"@sentry/core": "latest || *",
15+
"@sentry/node": "latest || *",
16+
"@sentry/types": "latest || *",
17+
"@trpc/server": "10.45.2",
18+
"@trpc/client": "10.45.2",
19+
"@types/express": "4.17.17",
20+
"@types/node": "18.15.1",
21+
"express": "4.19.2",
22+
"typescript": "4.9.5",
23+
"zod": "~3.22.4"
24+
},
25+
"devDependencies": {
26+
"@playwright/test": "^1.44.1",
27+
"@sentry-internal/test-utils": "link:../../../test-utils"
28+
},
29+
"volta": {
30+
"extends": "../../package.json"
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { getPlaywrightConfig } from '@sentry-internal/test-utils';
2+
3+
const config = getPlaywrightConfig({
4+
startCommand: `pnpm start`,
5+
});
6+
7+
export default config;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
declare global {
2+
namespace globalThis {
3+
var transactionIds: string[];
4+
}
5+
}
6+
7+
import express from 'express';
8+
9+
const app = express();
10+
const port = 3030;
11+
12+
// import and init sentry last for missing instrumentation
13+
import * as Sentry from '@sentry/node';
14+
Sentry.init({
15+
environment: 'qa', // dynamic sampling bias to keep transactions
16+
dsn: process.env.E2E_TEST_DSN,
17+
includeLocalVariables: true,
18+
debug: !!process.env.DEBUG,
19+
tunnel: `http://localhost:3031/`, // proxy server
20+
tracesSampleRate: 1,
21+
});
22+
23+
app.get('/test-exception/:id', function (req, _res) {
24+
throw new Error(`This is an exception with id ${req.params.id}`);
25+
});
26+
27+
Sentry.setupExpressErrorHandler(app);
28+
29+
// @ts-ignore
30+
app.use(function onError(err, req, res, next) {
31+
// The error id is attached to `res.sentry` to be returned
32+
// and optionally displayed to the user for support.
33+
res.statusCode = 500;
34+
res.end(res.sentry + '\n');
35+
});
36+
37+
app.listen(port, () => {
38+
console.log(`Example app listening on port ${port}`);
39+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { startEventProxyServer } from '@sentry-internal/test-utils';
2+
3+
startEventProxyServer({
4+
port: 3031,
5+
proxyServerName: 'node-express',
6+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { expect, test } from '@playwright/test';
2+
import { waitForError } from '@sentry-internal/test-utils';
3+
4+
test('Sends correct context when instrumentation was set up incorrectly', async ({ baseURL }) => {
5+
const errorEventPromise = waitForError('node-express', event => {
6+
return !event.type && event.exception?.values?.[0]?.value === 'This is an exception with id 123';
7+
});
8+
9+
await fetch(`${baseURL}/test-exception/123`);
10+
11+
const errorEvent = await errorEventPromise;
12+
13+
expect(errorEvent.exception?.values).toHaveLength(1);
14+
expect(errorEvent.exception?.values?.[0]?.value).toBe('This is an exception with id 123');
15+
16+
expect(errorEvent.contexts?.missing_instrumentation).toEqual({
17+
package: 'express',
18+
'javascript.is_cjs': true,
19+
});
20+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"types": ["node"],
4+
"esModuleInterop": true,
5+
"lib": ["es2018"],
6+
"strict": true,
7+
"outDir": "dist"
8+
},
9+
"include": ["src/**/*.ts"]
10+
}

dev-packages/e2e-tests/test-applications/react-router-6/tests/transactions.test.ts

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from '@playwright/test';
2-
import { waitForTransaction } from '@sentry-internal/test-utils';
2+
import { waitForEnvelopeItem, waitForTransaction } from '@sentry-internal/test-utils';
33

44
test('sends a pageload transaction with a parameterized URL', async ({ page }) => {
55
const transactionPromise = waitForTransaction('react-router-6', async transactionEvent => {
@@ -54,3 +54,45 @@ test('sends a navigation transaction with a parameterized URL', async ({ page })
5454
},
5555
});
5656
});
57+
58+
test('sends an INP span', async ({ page }) => {
59+
const inpSpanPromise = waitForEnvelopeItem('react-router-6', item => {
60+
return item[0].type === 'span';
61+
});
62+
63+
await page.goto(`/`);
64+
65+
await page.click('#exception-button');
66+
67+
await page.waitForTimeout(500);
68+
69+
// Page hide to trigger INP
70+
await page.evaluate(() => {
71+
window.dispatchEvent(new Event('pagehide'));
72+
});
73+
74+
const inpSpan = await inpSpanPromise;
75+
76+
expect(inpSpan[1]).toEqual({
77+
data: {
78+
'sentry.origin': 'auto.http.browser.inp',
79+
'sentry.op': 'ui.interaction.click',
80+
release: 'e2e-test',
81+
environment: 'qa',
82+
transaction: '/',
83+
'sentry.exclusive_time': expect.any(Number),
84+
replay_id: expect.any(String),
85+
},
86+
description: 'body > div#root > input#exception-button[type="button"]',
87+
op: 'ui.interaction.click',
88+
parent_span_id: expect.any(String),
89+
span_id: expect.any(String),
90+
start_timestamp: expect.any(Number),
91+
timestamp: expect.any(Number),
92+
trace_id: expect.any(String),
93+
origin: 'auto.http.browser.inp',
94+
exclusive_time: expect.any(Number),
95+
measurements: { inp: { unit: 'millisecond', value: expect.any(Number) } },
96+
segment_id: expect.any(String),
97+
});
98+
});

0 commit comments

Comments
 (0)