Skip to content

meta(changelog): Update changelog for 9.20.0 #16312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = [
path: 'packages/browser/build/npm/esm/index.js',
import: createImport('init'),
gzip: true,
limit: '24 KB',
limit: '25 KB',
},
{
name: '@sentry/browser - with treeshaking flags',
Expand Down Expand Up @@ -52,7 +52,7 @@ module.exports = [
path: 'packages/browser/build/npm/esm/index.js',
import: createImport('init', 'browserTracingIntegration', 'replayIntegration'),
gzip: true,
limit: '70.1 KB',
limit: '71 KB',
modifyWebpackConfig: function (config) {
const webpack = require('webpack');

Expand Down Expand Up @@ -206,7 +206,7 @@ module.exports = [
import: createImport('init'),
ignore: ['next/router', 'next/constants'],
gzip: true,
limit: '42 KB',
limit: '42.5 KB',
},
// SvelteKit SDK (ESM)
{
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,26 @@

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

## 9.20.0

### Important changes

- **feat(browser): Track measure detail as span attributes ([#16240](https://github.com/getsentry/sentry-javascript/pull/16240))**

The SDK now automatically collects details passed to `performance.measure` options.

### Other changes

- feat(node): Add `maxIncomingRequestBodySize` ([#16225](https://github.com/getsentry/sentry-javascript/pull/16225))
- feat(react-router): Add server action instrumentation ([#16292](https://github.com/getsentry/sentry-javascript/pull/16292))
- feat(react-router): Filter manifest requests ([#16294](https://github.com/getsentry/sentry-javascript/pull/16294))
- feat(replay): Extend default list for masking with `aria-label` ([#16192](https://github.com/getsentry/sentry-javascript/pull/16192))
- fix(browser): Ensure pageload & navigation spans have correct data ([#16279](https://github.com/getsentry/sentry-javascript/pull/16279))
- fix(cloudflare): Account for static fields in wrapper type ([#16303](https://github.com/getsentry/sentry-javascript/pull/16303))
- fix(nextjs): Preserve `next.route` attribute on root spans ([#16297](https://github.com/getsentry/sentry-javascript/pull/16297))
- feat(node): Fork isolation scope in tRPC middleware ([#16296](https://github.com/getsentry/sentry-javascript/pull/16296))
- feat(core): Add `orgId` option to `init` and DSC (`sentry-org_id` in baggage) ([#16305](https://github.com/getsentry/sentry-javascript/pull/16305))

## 9.19.0

- feat(react-router): Add otel instrumentation for server requests ([#16147](https://github.com/getsentry/sentry-javascript/pull/16147))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ sentryTest('should record history changes as navigation breadcrumbs', async ({ g
category: 'navigation',
data: {
from: '/bar?a=1#fragment',
to: '[object Object]',
to: '/[object%20Object]',
},
timestamp: expect.any(Number),
},
{
category: 'navigation',
data: {
from: '[object Object]',
from: '/[object%20Object]',
to: '/bar?a=1#fragment',
},
timestamp: expect.any(Number),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ sentryTest(
nodeId: expect.any(Number),
node: {
attributes: {
'aria-label': 'An Error in aria-label',
'aria-label': '** ***** ** **********',
class: 'btn btn-error',
id: 'error',
role: 'button',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ sentryTest(
expect(replayEvent6).toEqual(
getExpectedReplayEvent({
segment_id: 6,
urls: ['/spa'],
urls: [`${TEST_HOST}/spa`],
request: {
url: `${TEST_HOST}/spa`,
headers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"type": 2,
"tagName": "button",
"attributes": {
"aria-label": "Click me",
"aria-label": "***** **",
"onclick": "console.log('Test log')"
},
"childNodes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"type": 2,
"tagName": "button",
"attributes": {
"aria-label": "Click me",
"aria-label": "***** **",
"onclick": "console.log('Test log')"
},
"childNodes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"type": 2,
"tagName": "button",
"attributes": {
"aria-label": "Click me",
"aria-label": "***** **",
"onclick": "console.log('Test log')"
},
"childNodes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"type": 2,
"tagName": "button",
"attributes": {
"aria-label": "Click me",
"aria-label": "***** **",
"onclick": "console.log('Test log')"
},
"childNodes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"type": 2,
"tagName": "button",
"attributes": {
"aria-label": "Click me",
"aria-label": "***** **",
"onclick": "console.log('Test log')"
},
"childNodes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"type": 2,
"tagName": "button",
"attributes": {
"aria-label": "Click me",
"aria-label": "***** **",
"onclick": "console.log('Test log')"
},
"childNodes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"type": 2,
"tagName": "button",
"attributes": {
"aria-label": "Click me",
"aria-label": "***** **",
"onclick": "console.log('Test log')"
},
"childNodes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"type": 2,
"tagName": "button",
"attributes": {
"aria-label": "Click me",
"aria-label": "***** **",
"onclick": "console.log('Test log')"
},
"childNodes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Sentry.init({
});

// Immediately navigate to a new page to abort the pageload
window.location.href = '#foo';
window.history.pushState({}, '', '/sub-page');
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ sentryTest(
expect(navigationTraceId).toBeDefined();
expect(pageloadTraceId).not.toEqual(navigationTraceId);

expect(pageloadRequest.transaction).toEqual('/index.html');
expect(navigationRequest.transaction).toEqual('/sub-page');

expect(pageloadRequest.contexts?.trace?.data).toMatchObject({
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
Expand All @@ -54,5 +57,17 @@ sentryTest(
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
['sentry.idle_span_finish_reason']: 'idleTimeout',
});
expect(pageloadRequest.request).toEqual({
headers: {
'User-Agent': expect.any(String),
},
url: 'http://sentry-test.io/index.html',
});
expect(navigationRequest.request).toEqual({
headers: {
'User-Agent': expect.any(String),
},
url: 'http://sentry-test.io/sub-page',
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import {
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
} from '@sentry/core';
import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
import {
envelopeRequestParser,
getFirstSentryEnvelopeRequest,
shouldSkipTracingTest,
waitForTransactionRequest,
} from '../../../../utils/helpers';

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

expect(pageloadRequest.transaction).toEqual('/index.html');
// Fragment is not in transaction name
expect(navigationRequest.transaction).toEqual('/index.html');

expect(pageloadRequest.contexts?.trace?.data).toMatchObject({
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
Expand All @@ -45,6 +54,18 @@ sentryTest('should create a navigation transaction on page navigation', async ({
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
['sentry.idle_span_finish_reason']: 'idleTimeout',
});
expect(pageloadRequest.request).toEqual({
headers: {
'User-Agent': expect.any(String),
},
url: 'http://sentry-test.io/index.html',
});
expect(navigationRequest.request).toEqual({
headers: {
'User-Agent': expect.any(String),
},
url: 'http://sentry-test.io/index.html#foo',
});

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

expect(pageloadSpanId).not.toEqual(navigationSpanId);
});

//
sentryTest('should handle pushState with full URL', async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

const url = await getLocalTestUrl({ testDir: __dirname });

const pageloadRequestPromise = waitForTransactionRequest(page, event => event.contexts?.trace?.op === 'pageload');
const navigationRequestPromise = waitForTransactionRequest(
page,
event => event.contexts?.trace?.op === 'navigation' && event.transaction === '/sub-page',
);
const navigationRequestPromise2 = waitForTransactionRequest(
page,
event => event.contexts?.trace?.op === 'navigation' && event.transaction === '/sub-page-2',
);

await page.goto(url);
await pageloadRequestPromise;

await page.evaluate("window.history.pushState({}, '', `${window.location.origin}/sub-page`);");

const navigationRequest = envelopeRequestParser(await navigationRequestPromise);

expect(navigationRequest.transaction).toEqual('/sub-page');

expect(navigationRequest.contexts?.trace?.data).toMatchObject({
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser',
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
['sentry.idle_span_finish_reason']: 'idleTimeout',
});
expect(navigationRequest.request).toEqual({
headers: {
'User-Agent': expect.any(String),
},
url: 'http://sentry-test.io/sub-page',
});

await page.evaluate("window.history.pushState({}, '', `${window.location.origin}/sub-page-2`);");

const navigationRequest2 = envelopeRequestParser(await navigationRequestPromise2);

expect(navigationRequest2.transaction).toEqual('/sub-page-2');

expect(navigationRequest2.contexts?.trace?.data).toMatchObject({
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser',
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
['sentry.idle_span_finish_reason']: 'idleTimeout',
});
expect(navigationRequest2.request).toEqual({
headers: {
'User-Agent': expect.any(String),
},
url: 'http://sentry-test.io/sub-page-2',
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ test('Sends a transaction for a request to app router', async ({ page }) => {
'http.status_code': 200,
'http.target': '/server-component/parameter/1337/42',
'otel.kind': 'SERVER',
'next.route': '/server-component/parameter/[...parameters]',
}),
op: 'http.server',
origin: 'auto',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export default [
route('with/:param', 'routes/performance/dynamic-param.tsx'),
route('static', 'routes/performance/static.tsx'),
route('server-loader', 'routes/performance/server-loader.tsx'),
route('server-action', 'routes/performance/server-action.tsx'),
]),
] satisfies RouteConfig;
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Form } from 'react-router';
import type { Route } from './+types/server-action';

export async function action({ request }: Route.ActionArgs) {
let formData = await request.formData();
let name = formData.get('name');
await new Promise(resolve => setTimeout(resolve, 1000));
return {
greeting: `Hola ${name}`,
};
}

export default function Project({ actionData }: Route.ComponentProps) {
return (
<div>
<h1>Server action page</h1>
<Form method="post">
<input type="text" name="name" />
<button type="submit">Submit</button>
</Form>
{actionData ? <p>{actionData.greeting}</p> : null}
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,31 @@ test.describe('servery - performance', () => {
origin: 'auto.http.react-router',
});
});

test('should automatically instrument server action', async ({ page }) => {
const txPromise = waitForTransaction(APP_NAME, async transactionEvent => {
return transactionEvent.transaction === 'POST /performance/server-action.data';
});

await page.goto(`/performance/server-action`);
await page.getByRole('button', { name: 'Submit' }).click(); // this will trigger a .data request

const transaction = await txPromise;

expect(transaction?.spans?.[transaction.spans?.length - 1]).toMatchObject({
span_id: expect.any(String),
trace_id: expect.any(String),
data: {
'sentry.origin': 'auto.http.react-router',
'sentry.op': 'function.react-router.action',
},
description: 'Executing Server Action',
parent_span_id: expect.any(String),
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
status: 'ok',
op: 'function.react-router.action',
origin: 'auto.http.react-router',
});
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterAll, describe } from 'vitest';
import { cleanupChildProcesses, createEsmAndCjsTests } from '../../../utils/runner';
import { cleanupChildProcesses, createEsmAndCjsTests } from '../../../../utils/runner';

describe('express with http import', () => {
afterAll(() => {
Expand Down
Loading
Loading