Skip to content

Commit 5eff48e

Browse files
authored
Merge branch 'develop' into onur/firebase-instrumentation
2 parents 4395b36 + a18f659 commit 5eff48e

File tree

74 files changed

+1064
-762
lines changed

Some content is hidden

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

74 files changed

+1064
-762
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ env:
4747
${{ github.workspace }}/packages/*/lib
4848
${{ github.workspace }}/packages/ember/*.d.ts
4949
${{ github.workspace }}/packages/gatsby/*.d.ts
50-
${{ github.workspace }}/packages/utils/cjs
51-
${{ github.workspace }}/packages/utils/esm
5250
5351
BUILD_CACHE_TARBALL_KEY: tarball-${{ github.event.inputs.commit || github.sha }}
5452

@@ -950,13 +948,13 @@ jobs:
950948
retention-days: 7
951949

952950
- name: Pre-process E2E Test Dumps
953-
if: always()
951+
if: failure()
954952
run: |
955953
node ./scripts/normalize-e2e-test-dump-transaction-events.js
956954
957955
- name: Upload E2E Test Event Dumps
958956
uses: actions/upload-artifact@v4
959-
if: always()
957+
if: failure()
960958
with:
961959
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
962960
path: ${{ runner.temp }}/test-application/event-dumps
@@ -1062,13 +1060,13 @@ jobs:
10621060
run: pnpm ${{ matrix.assert-command || 'test:assert' }}
10631061

10641062
- name: Pre-process E2E Test Dumps
1065-
if: always()
1063+
if: failure()
10661064
run: |
10671065
node ./scripts/normalize-e2e-test-dump-transaction-events.js
10681066
10691067
- name: Upload E2E Test Event Dumps
10701068
uses: actions/upload-artifact@v4
1071-
if: always()
1069+
if: failure()
10721070
with:
10731071
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
10741072
path: ${{ runner.temp }}/test-application/event-dumps

MIGRATION.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,20 @@ Additionally, we hold ourselves accountable to any security issues, meaning that
7070

7171
Note, that it is decided on a case-per-case basis, what gets backported or not.
7272
If you need a fix or feature in a previous version of the SDK, please reach out via a GitHub Issue.
73+
74+
## 3. Behaviour Changes
75+
76+
### Removal of First Input Delay (FID) Web Vital Reporting
77+
78+
Affected SDKs: All SDKs running in browser applications (`@sentry/browser`, `@sentry/react`, `@sentry/nextjs`, etc.)
79+
80+
In v10, the SDK stopped reporting the First Input Delay (FID) web vital.
81+
This was done because FID has been replaced by Interaction to Next Paint (INP) and is therefore no longer relevant for assessing and tracking a website's performance.
82+
For reference, FID has long been deprecated by Google's official `web-vitals` library and was eventually removed in version `5.0.0`.
83+
Sentry now follows Google's lead by also removing it.
84+
85+
The removal entails **no breaking API changes**. However, in rare cases, you might need to adjust some of your Sentry SDK and product setup:
86+
87+
- Remove any logic in `beforeSend` or other filtering/event processing logic that depends on FID or replace it with INP logic.
88+
- If you set up Sentry Alerts that depend on FID, be aware that these could trigger once you upgrade the SDK, due to a lack of new values.
89+
To replace them, adjust your alerts (or dashbaords) to use INP.

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
expectedClickBreadcrumb,
55
expectedCLSPerformanceSpan,
66
expectedFCPPerformanceSpan,
7-
expectedFIDPerformanceSpan,
87
expectedFPPerformanceSpan,
98
expectedLCPPerformanceSpan,
109
expectedMemoryPerformanceSpan,
@@ -56,7 +55,6 @@ sentryTest(
5655
expectedNavigationPerformanceSpan,
5756
expectedLCPPerformanceSpan,
5857
expectedCLSPerformanceSpan,
59-
expectedFIDPerformanceSpan,
6058
expectedFPPerformanceSpan,
6159
expectedFCPPerformanceSpan,
6260
expectedMemoryPerformanceSpan, // two memory spans - once per flush

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
expectedClickBreadcrumb,
55
expectedCLSPerformanceSpan,
66
expectedFCPPerformanceSpan,
7-
expectedFIDPerformanceSpan,
87
expectedFPPerformanceSpan,
98
expectedLCPPerformanceSpan,
109
expectedMemoryPerformanceSpan,
@@ -77,7 +76,6 @@ sentryTest(
7776
expectedNavigationPerformanceSpan,
7877
expectedLCPPerformanceSpan,
7978
expectedCLSPerformanceSpan,
80-
expectedFIDPerformanceSpan,
8179
expectedFPPerformanceSpan,
8280
expectedFCPPerformanceSpan,
8381
expectedMemoryPerformanceSpan, // two memory spans - once per flush
@@ -117,7 +115,6 @@ sentryTest(
117115
expectedReloadPerformanceSpan,
118116
expectedLCPPerformanceSpan,
119117
expectedCLSPerformanceSpan,
120-
expectedFIDPerformanceSpan,
121118
expectedFPPerformanceSpan,
122119
expectedFCPPerformanceSpan,
123120
expectedMemoryPerformanceSpan,
@@ -188,7 +185,6 @@ sentryTest(
188185
expectedNavigationPerformanceSpan,
189186
expectedLCPPerformanceSpan,
190187
expectedCLSPerformanceSpan,
191-
expectedFIDPerformanceSpan,
192188
expectedFPPerformanceSpan,
193189
expectedFCPPerformanceSpan,
194190
expectedMemoryPerformanceSpan,
@@ -326,7 +322,6 @@ sentryTest(
326322
expectedNavigationPerformanceSpan,
327323
expectedLCPPerformanceSpan,
328324
expectedCLSPerformanceSpan,
329-
expectedFIDPerformanceSpan,
330325
expectedFPPerformanceSpan,
331326
expectedFCPPerformanceSpan,
332327
expectedMemoryPerformanceSpan,

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-fid/template.html

Lines changed: 0 additions & 9 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-fid/test.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

dev-packages/browser-integration-tests/utils/replayEventTemplates.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,6 @@ export const expectedCLSPerformanceSpan = {
148148
},
149149
};
150150

151-
export const expectedFIDPerformanceSpan = {
152-
op: 'web-vital',
153-
description: 'first-input-delay',
154-
startTimestamp: expect.any(Number),
155-
endTimestamp: expect.any(Number),
156-
data: {
157-
value: expect.any(Number),
158-
rating: expect.any(String),
159-
size: expect.any(Number),
160-
nodeIds: expect.any(Array),
161-
},
162-
};
163-
164151
export const expectedINPPerformanceSpan = {
165152
op: 'web-vital',
166153
description: 'interaction-to-next-paint',

dev-packages/e2e-tests/lib/getTestMatrix.ts

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,27 @@ function getAffectedTestApplications(
143143
.map(line => line.trim())
144144
.filter(Boolean);
145145

146-
// If something in e2e tests themselves are changed, just run everything
146+
// If something in e2e tests themselves are changed, check if only test applications were changed
147147
if (affectedProjects.includes('@sentry-internal/e2e-tests')) {
148+
try {
149+
const changedTestApps = getChangedTestApps(base, head);
150+
151+
// Shared code was changed, run all tests
152+
if (changedTestApps === false) {
153+
return testApplications;
154+
}
155+
156+
// Only test applications that were changed, run selectively
157+
if (changedTestApps.size > 0) {
158+
return testApplications.filter(testApp => changedTestApps.has(testApp));
159+
}
160+
} catch (error) {
161+
// eslint-disable-next-line no-console
162+
console.error('Failed to get changed files, running all tests:', error);
163+
return testApplications;
164+
}
165+
166+
// Fall back to running all tests
148167
return testApplications;
149168
}
150169

@@ -153,3 +172,32 @@ function getAffectedTestApplications(
153172
return sentryDependencies.some(dep => affectedProjects.includes(dep));
154173
});
155174
}
175+
176+
function getChangedTestApps(base: string, head?: string): false | Set<string> {
177+
const changedFiles = execSync(`git diff --name-only ${base}${head ? `..${head}` : ''} -- dev-packages/e2e-tests/`, {
178+
encoding: 'utf-8',
179+
})
180+
.toString()
181+
.split('\n')
182+
.map(line => line.trim())
183+
.filter(Boolean);
184+
185+
const changedTestApps: Set<string> = new Set();
186+
const testAppsPrefix = 'dev-packages/e2e-tests/test-applications/';
187+
188+
for (const file of changedFiles) {
189+
if (!file.startsWith(testAppsPrefix)) {
190+
// Shared code change - need to run all tests
191+
return false;
192+
}
193+
194+
const pathAfterPrefix = file.slice(testAppsPrefix.length);
195+
const slashIndex = pathAfterPrefix.indexOf('/');
196+
197+
if (slashIndex > 0) {
198+
changedTestApps.add(pathAfterPrefix.slice(0, slashIndex));
199+
}
200+
}
201+
202+
return changedTestApps;
203+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
import Layout from '../../layouts/Layout.astro';
3+
4+
export const prerender = false;
5+
6+
---
7+
8+
<Layout title="User Settings">
9+
<h1>User Settings</h1>
10+
</Layout>

dev-packages/e2e-tests/test-applications/astro-4/tests/tracing.dynamic.test.ts

Lines changed: 73 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ test.describe('tracing in dynamically rendered (ssr) routes', () => {
3030
trace: {
3131
data: expect.objectContaining({
3232
'sentry.op': 'pageload',
33-
'sentry.origin': 'auto.pageload.browser',
34-
'sentry.source': 'url',
33+
'sentry.origin': 'auto.pageload.astro',
34+
'sentry.source': 'route',
3535
}),
3636
op: 'pageload',
37-
origin: 'auto.pageload.browser',
37+
origin: 'auto.pageload.astro',
3838
span_id: expect.stringMatching(/[a-f0-9]{16}/),
3939
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
4040
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
@@ -55,9 +55,7 @@ test.describe('tracing in dynamically rendered (ssr) routes', () => {
5555
start_timestamp: expect.any(Number),
5656
timestamp: expect.any(Number),
5757
transaction: '/test-ssr',
58-
transaction_info: {
59-
source: 'url',
60-
},
58+
transaction_info: { source: 'route' },
6159
type: 'transaction',
6260
});
6361

@@ -113,9 +111,7 @@ test.describe('tracing in dynamically rendered (ssr) routes', () => {
113111
start_timestamp: expect.any(Number),
114112
timestamp: expect.any(Number),
115113
transaction: 'GET /test-ssr',
116-
transaction_info: {
117-
source: 'route',
118-
},
114+
transaction_info: { source: 'route' },
119115
type: 'transaction',
120116
});
121117
});
@@ -194,18 +190,21 @@ test.describe('nested SSR routes (client, server, server request)', () => {
194190
span => span.op === 'http.client' && span.description?.includes('/api/user/'),
195191
);
196192

193+
const routeNameMetaContent = await page.locator('meta[name="sentry-route-name"]').getAttribute('content');
194+
expect(routeNameMetaContent).toBe('%2Fuser-page%2F%5BuserId%5D');
195+
197196
// Client pageload transaction - actual URL with pageload operation
198197
expect(clientPageloadTxn).toMatchObject({
199-
transaction: '/user-page/myUsername123', // todo: parametrize
200-
transaction_info: { source: 'url' },
198+
transaction: '/user-page/[userId]',
199+
transaction_info: { source: 'route' },
201200
contexts: {
202201
trace: {
203202
op: 'pageload',
204-
origin: 'auto.pageload.browser',
203+
origin: 'auto.pageload.astro',
205204
data: {
206205
'sentry.op': 'pageload',
207-
'sentry.origin': 'auto.pageload.browser',
208-
'sentry.source': 'url',
206+
'sentry.origin': 'auto.pageload.astro',
207+
'sentry.source': 'route',
209208
},
210209
},
211210
},
@@ -275,20 +274,23 @@ test.describe('nested SSR routes (client, server, server request)', () => {
275274

276275
await page.goto('/catchAll/hell0/whatever-do');
277276

277+
const routeNameMetaContent = await page.locator('meta[name="sentry-route-name"]').getAttribute('content');
278+
expect(routeNameMetaContent).toBe('%2FcatchAll%2F%5Bpath%5D');
279+
278280
const clientPageloadTxn = await clientPageloadTxnPromise;
279281
const serverPageRequestTxn = await serverPageRequestTxnPromise;
280282

281283
expect(clientPageloadTxn).toMatchObject({
282-
transaction: '/catchAll/hell0/whatever-do', // todo: parametrize
283-
transaction_info: { source: 'url' },
284+
transaction: '/catchAll/[path]',
285+
transaction_info: { source: 'route' },
284286
contexts: {
285287
trace: {
286288
op: 'pageload',
287-
origin: 'auto.pageload.browser',
289+
origin: 'auto.pageload.astro',
288290
data: {
289291
'sentry.op': 'pageload',
290-
'sentry.origin': 'auto.pageload.browser',
291-
'sentry.source': 'url',
292+
'sentry.origin': 'auto.pageload.astro',
293+
'sentry.source': 'route',
292294
},
293295
},
294296
},
@@ -313,3 +315,55 @@ test.describe('nested SSR routes (client, server, server request)', () => {
313315
});
314316
});
315317
});
318+
319+
// Case for `user-page/[id]` vs. `user-page/settings` static routes
320+
test.describe('parametrized vs static paths', () => {
321+
test('should use static route name for static route in parametrized path', async ({ page }) => {
322+
const clientPageloadTxnPromise = waitForTransaction('astro-4', txnEvent => {
323+
return txnEvent?.transaction?.startsWith('/user-page/') ?? false;
324+
});
325+
326+
const serverPageRequestTxnPromise = waitForTransaction('astro-4', txnEvent => {
327+
return txnEvent?.transaction?.startsWith('GET /user-page/') ?? false;
328+
});
329+
330+
await page.goto('/user-page/settings');
331+
332+
const clientPageloadTxn = await clientPageloadTxnPromise;
333+
const serverPageRequestTxn = await serverPageRequestTxnPromise;
334+
335+
expect(clientPageloadTxn).toMatchObject({
336+
transaction: '/user-page/settings',
337+
transaction_info: { source: 'route' },
338+
contexts: {
339+
trace: {
340+
op: 'pageload',
341+
origin: 'auto.pageload.astro',
342+
data: {
343+
'sentry.op': 'pageload',
344+
'sentry.origin': 'auto.pageload.astro',
345+
'sentry.source': 'route',
346+
},
347+
},
348+
},
349+
});
350+
351+
expect(serverPageRequestTxn).toMatchObject({
352+
transaction: 'GET /user-page/settings',
353+
transaction_info: { source: 'route' },
354+
contexts: {
355+
trace: {
356+
op: 'http.server',
357+
origin: 'auto.http.astro',
358+
data: {
359+
'sentry.op': 'http.server',
360+
'sentry.origin': 'auto.http.astro',
361+
'sentry.source': 'route',
362+
url: expect.stringContaining('/user-page/settings'),
363+
},
364+
},
365+
},
366+
request: { url: expect.stringContaining('/user-page/settings') },
367+
});
368+
});
369+
});

0 commit comments

Comments
 (0)