Skip to content

Commit dac1e80

Browse files
authored
Merge pull request #16312 from getsentry/prepare-release/9.20.0
meta(changelog): Update changelog for 9.20.0
2 parents f67b7b7 + 6da8816 commit dac1e80

File tree

63 files changed

+1334
-120
lines changed

Some content is hidden

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

63 files changed

+1334
-120
lines changed

.size-limit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = [
88
path: 'packages/browser/build/npm/esm/index.js',
99
import: createImport('init'),
1010
gzip: true,
11-
limit: '24 KB',
11+
limit: '25 KB',
1212
},
1313
{
1414
name: '@sentry/browser - with treeshaking flags',
@@ -52,7 +52,7 @@ module.exports = [
5252
path: 'packages/browser/build/npm/esm/index.js',
5353
import: createImport('init', 'browserTracingIntegration', 'replayIntegration'),
5454
gzip: true,
55-
limit: '70.1 KB',
55+
limit: '71 KB',
5656
modifyWebpackConfig: function (config) {
5757
const webpack = require('webpack');
5858

@@ -206,7 +206,7 @@ module.exports = [
206206
import: createImport('init'),
207207
ignore: ['next/router', 'next/constants'],
208208
gzip: true,
209-
limit: '42 KB',
209+
limit: '42.5 KB',
210210
},
211211
// SvelteKit SDK (ESM)
212212
{

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@
1010

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

13+
## 9.20.0
14+
15+
### Important changes
16+
17+
- **feat(browser): Track measure detail as span attributes ([#16240](https://github.com/getsentry/sentry-javascript/pull/16240))**
18+
19+
The SDK now automatically collects details passed to `performance.measure` options.
20+
21+
### Other changes
22+
23+
- feat(node): Add `maxIncomingRequestBodySize` ([#16225](https://github.com/getsentry/sentry-javascript/pull/16225))
24+
- feat(react-router): Add server action instrumentation ([#16292](https://github.com/getsentry/sentry-javascript/pull/16292))
25+
- feat(react-router): Filter manifest requests ([#16294](https://github.com/getsentry/sentry-javascript/pull/16294))
26+
- feat(replay): Extend default list for masking with `aria-label` ([#16192](https://github.com/getsentry/sentry-javascript/pull/16192))
27+
- fix(browser): Ensure pageload & navigation spans have correct data ([#16279](https://github.com/getsentry/sentry-javascript/pull/16279))
28+
- fix(cloudflare): Account for static fields in wrapper type ([#16303](https://github.com/getsentry/sentry-javascript/pull/16303))
29+
- fix(nextjs): Preserve `next.route` attribute on root spans ([#16297](https://github.com/getsentry/sentry-javascript/pull/16297))
30+
- feat(node): Fork isolation scope in tRPC middleware ([#16296](https://github.com/getsentry/sentry-javascript/pull/16296))
31+
- feat(core): Add `orgId` option to `init` and DSC (`sentry-org_id` in baggage) ([#16305](https://github.com/getsentry/sentry-javascript/pull/16305))
32+
1333
## 9.19.0
1434

1535
- feat(react-router): Add otel instrumentation for server requests ([#16147](https://github.com/getsentry/sentry-javascript/pull/16147))

dev-packages/browser-integration-tests/suites/integrations/Breadcrumbs/history/navigation/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ sentryTest('should record history changes as navigation breadcrumbs', async ({ g
2929
category: 'navigation',
3030
data: {
3131
from: '/bar?a=1#fragment',
32-
to: '[object Object]',
32+
to: '/[object%20Object]',
3333
},
3434
timestamp: expect.any(Number),
3535
},
3636
{
3737
category: 'navigation',
3838
data: {
39-
from: '[object Object]',
39+
from: '/[object%20Object]',
4040
to: '/bar?a=1#fragment',
4141
},
4242
timestamp: expect.any(Number),

dev-packages/browser-integration-tests/suites/replay/customEvents/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ sentryTest(
104104
nodeId: expect.any(Number),
105105
node: {
106106
attributes: {
107-
'aria-label': 'An Error in aria-label',
107+
'aria-label': '** ***** ** **********',
108108
class: 'btn btn-error',
109109
id: 'error',
110110
role: 'button',

dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ sentryTest(
210210
expect(replayEvent6).toEqual(
211211
getExpectedReplayEvent({
212212
segment_id: 6,
213-
urls: ['/spa'],
213+
urls: [`${TEST_HOST}/spa`],
214214
request: {
215215
url: `${TEST_HOST}/spa`,
216216
headers: {

dev-packages/browser-integration-tests/suites/replay/privacyBlock/test.ts-snapshots/privacy-chromium.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"type": 2,
6363
"tagName": "button",
6464
"attributes": {
65-
"aria-label": "Click me",
65+
"aria-label": "***** **",
6666
"onclick": "console.log('Test log')"
6767
},
6868
"childNodes": [

dev-packages/browser-integration-tests/suites/replay/privacyBlock/test.ts-snapshots/privacy-firefox.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"type": 2,
6363
"tagName": "button",
6464
"attributes": {
65-
"aria-label": "Click me",
65+
"aria-label": "***** **",
6666
"onclick": "console.log('Test log')"
6767
},
6868
"childNodes": [

dev-packages/browser-integration-tests/suites/replay/privacyBlock/test.ts-snapshots/privacy-webkit.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"type": 2,
6363
"tagName": "button",
6464
"attributes": {
65-
"aria-label": "Click me",
65+
"aria-label": "***** **",
6666
"onclick": "console.log('Test log')"
6767
},
6868
"childNodes": [

dev-packages/browser-integration-tests/suites/replay/privacyBlock/test.ts-snapshots/privacy.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"type": 2,
6363
"tagName": "button",
6464
"attributes": {
65-
"aria-label": "Click me",
65+
"aria-label": "***** **",
6666
"onclick": "console.log('Test log')"
6767
},
6868
"childNodes": [

dev-packages/browser-integration-tests/suites/replay/privacyDefault/test.ts-snapshots/privacy-chromium.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"type": 2,
6363
"tagName": "button",
6464
"attributes": {
65-
"aria-label": "Click me",
65+
"aria-label": "***** **",
6666
"onclick": "console.log('Test log')"
6767
},
6868
"childNodes": [

dev-packages/browser-integration-tests/suites/replay/privacyDefault/test.ts-snapshots/privacy-firefox.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"type": 2,
6363
"tagName": "button",
6464
"attributes": {
65-
"aria-label": "Click me",
65+
"aria-label": "***** **",
6666
"onclick": "console.log('Test log')"
6767
},
6868
"childNodes": [

dev-packages/browser-integration-tests/suites/replay/privacyDefault/test.ts-snapshots/privacy-webkit.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"type": 2,
6363
"tagName": "button",
6464
"attributes": {
65-
"aria-label": "Click me",
65+
"aria-label": "***** **",
6666
"onclick": "console.log('Test log')"
6767
},
6868
"childNodes": [

dev-packages/browser-integration-tests/suites/replay/privacyDefault/test.ts-snapshots/privacy.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"type": 2,
6363
"tagName": "button",
6464
"attributes": {
65-
"aria-label": "Click me",
65+
"aria-label": "***** **",
6666
"onclick": "console.log('Test log')"
6767
},
6868
"childNodes": [

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/navigation-aborting-pageload/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ Sentry.init({
99
});
1010

1111
// Immediately navigate to a new page to abort the pageload
12-
window.location.href = '#foo';
12+
window.history.pushState({}, '', '/sub-page');

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/navigation-aborting-pageload/test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ sentryTest(
4040
expect(navigationTraceId).toBeDefined();
4141
expect(pageloadTraceId).not.toEqual(navigationTraceId);
4242

43+
expect(pageloadRequest.transaction).toEqual('/index.html');
44+
expect(navigationRequest.transaction).toEqual('/sub-page');
45+
4346
expect(pageloadRequest.contexts?.trace?.data).toMatchObject({
4447
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
4548
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
@@ -54,5 +57,17 @@ sentryTest(
5457
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
5558
['sentry.idle_span_finish_reason']: 'idleTimeout',
5659
});
60+
expect(pageloadRequest.request).toEqual({
61+
headers: {
62+
'User-Agent': expect.any(String),
63+
},
64+
url: 'http://sentry-test.io/index.html',
65+
});
66+
expect(navigationRequest.request).toEqual({
67+
headers: {
68+
'User-Agent': expect.any(String),
69+
},
70+
url: 'http://sentry-test.io/sub-page',
71+
});
5772
},
5873
);

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/navigation/test.ts

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ import {
77
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
88
} from '@sentry/core';
99
import { sentryTest } from '../../../../utils/fixtures';
10-
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
10+
import {
11+
envelopeRequestParser,
12+
getFirstSentryEnvelopeRequest,
13+
shouldSkipTracingTest,
14+
waitForTransactionRequest,
15+
} from '../../../../utils/helpers';
1116

1217
sentryTest('should create a navigation transaction on page navigation', async ({ getLocalTestUrl, page }) => {
1318
if (shouldSkipTracingTest()) {
@@ -31,6 +36,10 @@ sentryTest('should create a navigation transaction on page navigation', async ({
3136
expect(navigationTraceId).toBeDefined();
3237
expect(pageloadTraceId).not.toEqual(navigationTraceId);
3338

39+
expect(pageloadRequest.transaction).toEqual('/index.html');
40+
// Fragment is not in transaction name
41+
expect(navigationRequest.transaction).toEqual('/index.html');
42+
3443
expect(pageloadRequest.contexts?.trace?.data).toMatchObject({
3544
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
3645
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
@@ -45,6 +54,18 @@ sentryTest('should create a navigation transaction on page navigation', async ({
4554
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
4655
['sentry.idle_span_finish_reason']: 'idleTimeout',
4756
});
57+
expect(pageloadRequest.request).toEqual({
58+
headers: {
59+
'User-Agent': expect.any(String),
60+
},
61+
url: 'http://sentry-test.io/index.html',
62+
});
63+
expect(navigationRequest.request).toEqual({
64+
headers: {
65+
'User-Agent': expect.any(String),
66+
},
67+
url: 'http://sentry-test.io/index.html#foo',
68+
});
4869

4970
const pageloadSpans = pageloadRequest.spans;
5071
const navigationSpans = navigationRequest.spans;
@@ -69,3 +90,65 @@ sentryTest('should create a navigation transaction on page navigation', async ({
6990

7091
expect(pageloadSpanId).not.toEqual(navigationSpanId);
7192
});
93+
94+
//
95+
sentryTest('should handle pushState with full URL', async ({ getLocalTestUrl, page }) => {
96+
if (shouldSkipTracingTest()) {
97+
sentryTest.skip();
98+
}
99+
100+
const url = await getLocalTestUrl({ testDir: __dirname });
101+
102+
const pageloadRequestPromise = waitForTransactionRequest(page, event => event.contexts?.trace?.op === 'pageload');
103+
const navigationRequestPromise = waitForTransactionRequest(
104+
page,
105+
event => event.contexts?.trace?.op === 'navigation' && event.transaction === '/sub-page',
106+
);
107+
const navigationRequestPromise2 = waitForTransactionRequest(
108+
page,
109+
event => event.contexts?.trace?.op === 'navigation' && event.transaction === '/sub-page-2',
110+
);
111+
112+
await page.goto(url);
113+
await pageloadRequestPromise;
114+
115+
await page.evaluate("window.history.pushState({}, '', `${window.location.origin}/sub-page`);");
116+
117+
const navigationRequest = envelopeRequestParser(await navigationRequestPromise);
118+
119+
expect(navigationRequest.transaction).toEqual('/sub-page');
120+
121+
expect(navigationRequest.contexts?.trace?.data).toMatchObject({
122+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser',
123+
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
124+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
125+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
126+
['sentry.idle_span_finish_reason']: 'idleTimeout',
127+
});
128+
expect(navigationRequest.request).toEqual({
129+
headers: {
130+
'User-Agent': expect.any(String),
131+
},
132+
url: 'http://sentry-test.io/sub-page',
133+
});
134+
135+
await page.evaluate("window.history.pushState({}, '', `${window.location.origin}/sub-page-2`);");
136+
137+
const navigationRequest2 = envelopeRequestParser(await navigationRequestPromise2);
138+
139+
expect(navigationRequest2.transaction).toEqual('/sub-page-2');
140+
141+
expect(navigationRequest2.contexts?.trace?.data).toMatchObject({
142+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser',
143+
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
144+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
145+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
146+
['sentry.idle_span_finish_reason']: 'idleTimeout',
147+
});
148+
expect(navigationRequest2.request).toEqual({
149+
headers: {
150+
'User-Agent': expect.any(String),
151+
},
152+
url: 'http://sentry-test.io/sub-page-2',
153+
});
154+
});

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ test('Sends a transaction for a request to app router', async ({ page }) => {
2525
'http.status_code': 200,
2626
'http.target': '/server-component/parameter/1337/42',
2727
'otel.kind': 'SERVER',
28+
'next.route': '/server-component/parameter/[...parameters]',
2829
}),
2930
op: 'http.server',
3031
origin: 'auto',

dev-packages/e2e-tests/test-applications/react-router-7-framework/app/routes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ export default [
1616
route('with/:param', 'routes/performance/dynamic-param.tsx'),
1717
route('static', 'routes/performance/static.tsx'),
1818
route('server-loader', 'routes/performance/server-loader.tsx'),
19+
route('server-action', 'routes/performance/server-action.tsx'),
1920
]),
2021
] satisfies RouteConfig;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Form } from 'react-router';
2+
import type { Route } from './+types/server-action';
3+
4+
export async function action({ request }: Route.ActionArgs) {
5+
let formData = await request.formData();
6+
let name = formData.get('name');
7+
await new Promise(resolve => setTimeout(resolve, 1000));
8+
return {
9+
greeting: `Hola ${name}`,
10+
};
11+
}
12+
13+
export default function Project({ actionData }: Route.ComponentProps) {
14+
return (
15+
<div>
16+
<h1>Server action page</h1>
17+
<Form method="post">
18+
<input type="text" name="name" />
19+
<button type="submit">Submit</button>
20+
</Form>
21+
{actionData ? <p>{actionData.greeting}</p> : null}
22+
</div>
23+
);
24+
}

dev-packages/e2e-tests/test-applications/react-router-7-framework/tests/performance/performance.server.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,31 @@ test.describe('servery - performance', () => {
132132
origin: 'auto.http.react-router',
133133
});
134134
});
135+
136+
test('should automatically instrument server action', async ({ page }) => {
137+
const txPromise = waitForTransaction(APP_NAME, async transactionEvent => {
138+
return transactionEvent.transaction === 'POST /performance/server-action.data';
139+
});
140+
141+
await page.goto(`/performance/server-action`);
142+
await page.getByRole('button', { name: 'Submit' }).click(); // this will trigger a .data request
143+
144+
const transaction = await txPromise;
145+
146+
expect(transaction?.spans?.[transaction.spans?.length - 1]).toMatchObject({
147+
span_id: expect.any(String),
148+
trace_id: expect.any(String),
149+
data: {
150+
'sentry.origin': 'auto.http.react-router',
151+
'sentry.op': 'function.react-router.action',
152+
},
153+
description: 'Executing Server Action',
154+
parent_span_id: expect.any(String),
155+
start_timestamp: expect.any(Number),
156+
timestamp: expect.any(Number),
157+
status: 'ok',
158+
op: 'function.react-router.action',
159+
origin: 'auto.http.react-router',
160+
});
161+
});
135162
});

dev-packages/node-integration-tests/suites/express/with-http/test.ts renamed to dev-packages/node-integration-tests/suites/express/with-http/base/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { afterAll, describe } from 'vitest';
2-
import { cleanupChildProcesses, createEsmAndCjsTests } from '../../../utils/runner';
2+
import { cleanupChildProcesses, createEsmAndCjsTests } from '../../../../utils/runner';
33

44
describe('express with http import', () => {
55
afterAll(() => {

0 commit comments

Comments
 (0)