Skip to content

Commit 9acaae2

Browse files
authored
Merge pull request #16288 from getsentry/prepare-release/9.19.0
meta(changelog): Update changelog for 9.19.0
2 parents a823652 + ed27663 commit 9acaae2

File tree

31 files changed

+950
-63
lines changed

31 files changed

+950
-63
lines changed

.size-limit.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ module.exports = [
1818
limit: '24.1 KB',
1919
modifyWebpackConfig: function (config) {
2020
const webpack = require('webpack');
21-
const TerserPlugin = require('terser-webpack-plugin');
2221

2322
config.plugins.push(
2423
new webpack.DefinePlugin({
@@ -30,7 +29,6 @@ module.exports = [
3029
);
3130

3231
config.optimization.minimize = true;
33-
config.optimization.minimizer = [new TerserPlugin()];
3432

3533
return config;
3634
},
@@ -57,7 +55,6 @@ module.exports = [
5755
limit: '70.1 KB',
5856
modifyWebpackConfig: function (config) {
5957
const webpack = require('webpack');
60-
const TerserPlugin = require('terser-webpack-plugin');
6158

6259
config.plugins.push(
6360
new webpack.DefinePlugin({
@@ -69,7 +66,6 @@ module.exports = [
6966
);
7067

7168
config.optimization.minimize = true;
72-
config.optimization.minimizer = [new TerserPlugin()];
7369

7470
return config;
7571
},
@@ -139,7 +135,7 @@ module.exports = [
139135
path: 'packages/vue/build/esm/index.js',
140136
import: createImport('init', 'browserTracingIntegration'),
141137
gzip: true,
142-
limit: '40 KB',
138+
limit: '41 KB',
143139
},
144140
// Svelte SDK (ESM)
145141
{
@@ -239,7 +235,6 @@ module.exports = [
239235
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
240236
modifyWebpackConfig: function (config) {
241237
const webpack = require('webpack');
242-
const TerserPlugin = require('terser-webpack-plugin');
243238

244239
config.plugins.push(
245240
new webpack.DefinePlugin({
@@ -248,7 +243,6 @@ module.exports = [
248243
);
249244

250245
config.optimization.minimize = true;
251-
config.optimization.minimizer = [new TerserPlugin()];
252246

253247
return config;
254248
},

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@
1010

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

13+
## 9.19.0
14+
15+
- feat(react-router): Add otel instrumentation for server requests ([#16147](https://github.com/getsentry/sentry-javascript/pull/16147))
16+
- feat(remix): Vendor in `opentelemetry-instrumentation-remix` ([#16145](https://github.com/getsentry/sentry-javascript/pull/16145))
17+
- fix(browser): Ensure spans auto-ended for navigations have `cancelled` reason ([#16277](https://github.com/getsentry/sentry-javascript/pull/16277))
18+
- fix(node): Pin `@fastify/otel` fork to direct url to allow installing without git ([#16287](https://github.com/getsentry/sentry-javascript/pull/16287))
19+
- fix(react): Handle nested parameterized routes in reactrouterv3 transaction normalization ([#16274](https://github.com/getsentry/sentry-javascript/pull/16274))
20+
21+
Work in this release was contributed by @sidx1024. Thank you for your contribution!
22+
1323
## 9.18.0
1424

1525
### Important changes
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
integrations: [Sentry.browserTracingIntegration()],
8+
tracesSampleRate: 1,
9+
});
10+
11+
// Immediately navigate to a new page to abort the pageload
12+
window.location.href = '#foo';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import { expect } from '@playwright/test';
2+
import {
3+
SEMANTIC_ATTRIBUTE_SENTRY_OP,
4+
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
5+
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
6+
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
7+
} from '@sentry/core';
8+
import { sentryTest } from '../../../../utils/fixtures';
9+
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../../utils/helpers';
10+
11+
sentryTest(
12+
'should create a navigation transaction that aborts an ongoing pageload',
13+
async ({ getLocalTestUrl, page }) => {
14+
if (shouldSkipTracingTest()) {
15+
sentryTest.skip();
16+
}
17+
18+
const url = await getLocalTestUrl({ testDir: __dirname });
19+
20+
const pageloadRequestPromise = waitForTransactionRequest(page, event => event.contexts?.trace?.op === 'pageload');
21+
const navigationRequestPromise = waitForTransactionRequest(
22+
page,
23+
event => event.contexts?.trace?.op === 'navigation',
24+
);
25+
26+
await page.goto(url);
27+
28+
const pageloadRequest = envelopeRequestParser(await pageloadRequestPromise);
29+
const navigationRequest = envelopeRequestParser(await navigationRequestPromise);
30+
31+
expect(pageloadRequest.contexts?.trace?.op).toBe('pageload');
32+
expect(navigationRequest.contexts?.trace?.op).toBe('navigation');
33+
34+
expect(navigationRequest.transaction_info?.source).toEqual('url');
35+
36+
const pageloadTraceId = pageloadRequest.contexts?.trace?.trace_id;
37+
const navigationTraceId = navigationRequest.contexts?.trace?.trace_id;
38+
39+
expect(pageloadTraceId).toBeDefined();
40+
expect(navigationTraceId).toBeDefined();
41+
expect(pageloadTraceId).not.toEqual(navigationTraceId);
42+
43+
expect(pageloadRequest.contexts?.trace?.data).toMatchObject({
44+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
45+
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
46+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
47+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
48+
['sentry.idle_span_finish_reason']: 'cancelled',
49+
});
50+
expect(navigationRequest.contexts?.trace?.data).toMatchObject({
51+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser',
52+
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
53+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
54+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
55+
['sentry.idle_span_finish_reason']: 'idleTimeout',
56+
});
57+
},
58+
);

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

+21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import { expect } from '@playwright/test';
22
import type { Event } from '@sentry/core';
3+
import {
4+
SEMANTIC_ATTRIBUTE_SENTRY_OP,
5+
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
6+
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
7+
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
8+
} from '@sentry/core';
39
import { sentryTest } from '../../../../utils/fixtures';
410
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
511

@@ -25,6 +31,21 @@ sentryTest('should create a navigation transaction on page navigation', async ({
2531
expect(navigationTraceId).toBeDefined();
2632
expect(pageloadTraceId).not.toEqual(navigationTraceId);
2733

34+
expect(pageloadRequest.contexts?.trace?.data).toMatchObject({
35+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
36+
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
37+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
38+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
39+
['sentry.idle_span_finish_reason']: 'idleTimeout',
40+
});
41+
expect(navigationRequest.contexts?.trace?.data).toMatchObject({
42+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser',
43+
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
44+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
45+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
46+
['sentry.idle_span_finish_reason']: 'idleTimeout',
47+
});
48+
2849
const pageloadSpans = pageloadRequest.spans;
2950
const navigationSpans = navigationRequest.spans;
3051

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

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ sentryTest('creates a pageload transaction with url as source', async ({ getLoca
3030
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
3131
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
3232
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
33+
['sentry.idle_span_finish_reason']: 'idleTimeout',
3334
});
3435

3536
expect(eventData.contexts?.trace?.op).toBe('pageload');

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

+1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ export default [
1515
route('ssr', 'routes/performance/ssr.tsx'),
1616
route('with/:param', 'routes/performance/dynamic-param.tsx'),
1717
route('static', 'routes/performance/static.tsx'),
18+
route('server-loader', 'routes/performance/server-loader.tsx'),
1819
]),
1920
] satisfies RouteConfig;

dev-packages/e2e-tests/test-applications/react-router-7-framework/app/routes/performance/dynamic-param.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import type { Route } from './+types/dynamic-param';
22

3+
export async function loader() {
4+
await new Promise(resolve => setTimeout(resolve, 500));
5+
return { data: 'burritos' };
6+
}
7+
38
export default function DynamicParamPage({ params }: Route.ComponentProps) {
49
const { param } = params;
510

dev-packages/e2e-tests/test-applications/react-router-7-framework/app/routes/performance/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export default function PerformancePage() {
77
<nav>
88
<Link to="/performance/ssr">SSR Page</Link>
99
<Link to="/performance/with/sentry">With Param Page</Link>
10+
<Link to="/performance/server-loader">Server Loader</Link>
1011
</nav>
1112
</div>
1213
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { Route } from './+types/server-loader';
2+
3+
export async function loader() {
4+
await new Promise(resolve => setTimeout(resolve, 500));
5+
return { data: 'burritos' };
6+
}
7+
8+
export default function ServerLoaderPage({ loaderData }: Route.ComponentProps) {
9+
const { data } = loaderData;
10+
return (
11+
<div>
12+
<h1>Server Loader Page</h1>
13+
<div>{data}</div>
14+
</div>
15+
);
16+
}

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

+28
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,32 @@ test.describe('servery - performance', () => {
104104
},
105105
});
106106
});
107+
108+
test('should automatically instrument server loader', async ({ page }) => {
109+
const txPromise = waitForTransaction(APP_NAME, async transactionEvent => {
110+
return transactionEvent.transaction === 'GET /performance/server-loader.data';
111+
});
112+
113+
await page.goto(`/performance`); // initial ssr pageloads do not contain .data requests
114+
await page.waitForTimeout(500); // quick breather before navigation
115+
await page.getByRole('link', { name: 'Server Loader' }).click(); // this will actually trigger a .data request
116+
117+
const transaction = await txPromise;
118+
119+
expect(transaction?.spans?.[transaction.spans?.length - 1]).toMatchObject({
120+
span_id: expect.any(String),
121+
trace_id: expect.any(String),
122+
data: {
123+
'sentry.origin': 'auto.http.react-router',
124+
'sentry.op': 'function.react-router.loader',
125+
},
126+
description: 'Executing Server Loader',
127+
parent_span_id: expect.any(String),
128+
start_timestamp: expect.any(Number),
129+
timestamp: expect.any(Number),
130+
status: 'ok',
131+
op: 'function.react-router.loader',
132+
origin: 'auto.http.react-router',
133+
});
134+
});
107135
});

dev-packages/size-limit-gh-action/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@actions/github": "^5.0.0",
2121
"@actions/glob": "0.4.0",
2222
"@actions/io": "1.1.3",
23-
"bytes": "3.1.2",
23+
"bytes-iec": "3.1.1",
2424
"markdown-table": "3.0.3"
2525
},
2626
"volta": {

dev-packages/size-limit-gh-action/utils/SizeLimitFormatter.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as core from '@actions/core';
2-
import bytes from 'bytes';
2+
import bytes from 'bytes-iec';
33

44
const SIZE_RESULTS_HEADER = ['Path', 'Size', '% Change', 'Change'];
55

packages/browser/src/tracing/browserTracingIntegration.ts

+1
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ export const browserTracingIntegration = ((_options: Partial<BrowserTracingOptio
386386
if (activeSpan && !spanToJSON(activeSpan).timestamp) {
387387
DEBUG_BUILD && logger.log(`[Tracing] Finishing current active span with op: ${spanToJSON(activeSpan).op}`);
388388
// If there's an open active span, we need to finish it before creating an new one.
389+
activeSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, 'cancelled');
389390
activeSpan.end();
390391
}
391392
}

packages/node/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"access": "public"
6666
},
6767
"dependencies": {
68-
"@fastify/otel": "getsentry/fastify-otel#otel-v1",
68+
"@fastify/otel": "https://codeload.github.com/getsentry/fastify-otel/tar.gz/ae3088d65e286bdc94ac5d722573537d6a6671bb",
6969
"@opentelemetry/api": "^1.9.0",
7070
"@opentelemetry/context-async-hooks": "^1.30.1",
7171
"@opentelemetry/core": "^1.30.1",

packages/react-router/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@opentelemetry/api": "^1.9.0",
3838
"@opentelemetry/core": "^1.30.1",
3939
"@opentelemetry/semantic-conventions": "^1.30.0",
40+
"@opentelemetry/instrumentation": "0.57.2",
4041
"@sentry/browser": "9.18.0",
4142
"@sentry/cli": "^2.43.0",
4243
"@sentry/core": "9.18.0",

0 commit comments

Comments
 (0)