From f4002378519ceb419b9127edc2d355b0dd41f0dd Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 28 Aug 2024 14:35:41 +0200 Subject: [PATCH 1/6] fix(browser): Remove faulty LCP, FCP and FP normalization logic --- .../assets/sentry-logo-600x179.png | Bin 0 -> 16118 bytes .../web-vitals-relations/template.html | 11 ++ .../metrics/web-vitals-relations/test.ts | 108 ++++++++++++++++++ .../src/metrics/browserMetrics.ts | 26 +---- 4 files changed, 124 insertions(+), 21 deletions(-) create mode 100644 dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/assets/sentry-logo-600x179.png create mode 100644 dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/template.html create mode 100644 dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/test.ts diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/assets/sentry-logo-600x179.png b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/assets/sentry-logo-600x179.png new file mode 100644 index 0000000000000000000000000000000000000000..353b7233d6bfa4f026f9998cacfa4add4bba9274 GIT binary patch literal 16118 zcmeHu^+S})7xyl#gwjYzhlrF&cOzZW-Q5k+0s<-_QZ6msEZvPD-L-UgN%#AB@AcmA z-|)V#KOoD_GtbPKGc)IWKA-bZNkJ0*G0|fX2!t*zC9VttA!q`>SD+vPKh?a9D}n#O zF3OUkpprq7Z4ih8BrPtY>Z!k<;+?FcR@FVl+at$>|46kYBS2WzfXAwjotEiQCvxwN z*ZVTy(;HRsciU<{RKJwo3YUIbdh#fEBMa>kME){Q_YpkV)ix;xAF}p61LdWZjgI-( ziUSKpHf}qMuT?`l(C1@rf@${?i~8P&hde#E&gTm@ls{=8!2wuU2%^F$C}2t~I&e69 zA_VuJj}*VZ1F>lS!UDeg>jTh`!Wh9AMukMb{6Ei8Ajziw*FqRYTuvBGy;GPb`QM%? zAf1LiY=8OyUiLl=HLUFuVP5e6zKoFZ9n$}Fi^T$F(ZoiK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h%0*>b9E=$mB2g^jHGTGLjN628QuA+?e@wz- zF8P~@l``tANH7|;gi84-+cn z{MMv@IK86HUvkwn{VDGorbl36(X=k# zYZ4W+8alQRRKmut`os|WUItPso?gMt5@z|fEV(5rlQhwLRFDW&GZ*pWOI$>ynRTs% zC`WdXUo7<`hbA4Hw_*709d}tMhhS$8)@3eBg1B0R;FQb4_pwmRKQ%X%#P8#u{YG+7 zL969G^)tiR%dw(8b#b$b0V|Vp!`i%dfB;M=6hc0=Bd)?v)?>;M`rP@CVc`&MOISHj zV-fuF=yMqPOMnDl9u@lalX^Aj;XV;;E-z}YX*Un391lDkwq`r+zOn9q#$FOF5e$ng z;4TG(gq%`3R@8qSR}ZDK-;ne#iKVivf!;m>btm^L4?yn4$Tb&g2G`-haSS1ZPs{&4 zr^e~jQ&`yuD3-G2pM^Uo{iVB1!ZTQT4E}p;gv3EihmZ>ZCnpN*!b@+nht7A#`p?5phF7hls{Ex3-myP3MUi{?9cK~yB< z0ni<8hleeNp@em>~gtpe3^usaUL64Drc|Tj5QlX!u|<)l=sv z$8J05OccWKW}R2g0ne|98vH3{=Krbd8b1Gh-_XfC*)Z2X)Od?`wQuEZ&4=-2sltAy zE`aYKUnL4!IkhG*{^BBDUo8N7mzuc)DSwsnJSRB-vUKIQ?wL|!nOvKJ{m=b1Y>i-N z0t*qz`g(p7Ewz6JgzP2F zWxMN%)kcDWEHWs6-0D4QWeR}tNb?$zKSCnI6t6%rd;x0YJYr0m$NC%VoR$AONPo=t z@RX~hM1gDbX-mk;H)=X;C4;#<{TgRI@qO<2z=3LKOmcL!+9A|T(3aDKj}9L;w7Snf&T~F Cl9AH@ literal 0 HcmV?d00001 diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/template.html b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/template.html new file mode 100644 index 000000000000..caf4b8f2deab --- /dev/null +++ b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/template.html @@ -0,0 +1,11 @@ + + + + + + +
+ + + + diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/test.ts b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/test.ts new file mode 100644 index 000000000000..e4dc773ec48c --- /dev/null +++ b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/test.ts @@ -0,0 +1,108 @@ +import type { Route } from '@playwright/test'; +import { expect } from '@playwright/test'; +import type { Event } from '@sentry/types'; + +import { sentryTest } from '../../../../utils/fixtures'; +import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers'; + +/** + * Bit of an odd test but we previously ran into cases where we would report TTFB > (LCP, FCP, FP) + * This should never happen and this test serves as a regression test for that. + * + * The problem is: We don't always get valid TTFB from the web-vitals library, so we skip the test if that's the case. + * Note: There is another test that covers that we actually report TTFB if it is valid (@see ../web-vitals-lcp/test.ts). + */ +sentryTest('paint web vitals values are greater than TTFB', async ({ browserName, getLocalTestPath, page }) => { + // Only run in chromium to ensure all vitals are present + if (shouldSkipTracingTest() || browserName !== 'chromium') { + sentryTest.skip(); + } + + page.route('**', route => route.continue()); + page.route('**/path/to/image.png', async (route: Route) => { + return route.fulfill({ path: `${__dirname}/assets/sentry-logo-600x179.png` }); + }); + + const url = await getLocalTestPath({ testDir: __dirname }); + const [eventData] = await Promise.all([ + getFirstSentryEnvelopeRequest(page), + page.goto(url), + page.locator('button').click(), + page.waitForTimeout(2000), + // page.waitForFunction(() => {}), + ]); + + expect(eventData.measurements).toBeDefined(); + + const ttfbValue = eventData.measurements?.ttfb?.value; + + if (!ttfbValue) { + // TTFB is unfortunately quite flaky. Sometimes, the web-vitals library doesn't report TTFB because + // responseStart is 0. This seems to happen somewhat randomly, so we just ignore this in that case. + // @see packages/browser-utils/src/metrics/web-vitals/onTTFB + + // logging the skip reason so that we at least can check for that in CI logs + // eslint-disable-next-line no-console + console.log('SKIPPING: TTFB is not reported'); + sentryTest.skip(); + } + + const lcpValue = eventData.measurements?.lcp?.value; + const fcpValue = eventData.measurements?.fcp?.value; + const fpValue = eventData.measurements?.fp?.value; + + expect(lcpValue).toBeDefined(); + expect(fcpValue).toBeDefined(); + expect(fpValue).toBeDefined(); + + // (LCP, FCP, FP) >= TTFB + expect(lcpValue).toBeGreaterThanOrEqual(ttfbValue!); + expect(fcpValue).toBeGreaterThanOrEqual(ttfbValue!); + expect(fpValue).toBeGreaterThanOrEqual(ttfbValue!); +}); + +/** + * Continuing the theme of odd tests, in this one, we check that LCP is greater or equal to FCP and FP. + * + * The problem: There are cases where for _some reason_ the browser reports lower LCP than FCP/FP values :( + * This might have to do with timing inaccuracies in the browser or with some weird bug in the PerformanceObserver + * or Web vitals library. While this shouldn't happen, checking that they're not _vastly_ off is at least better + * than not checking at all, so we factor in a margin of error. + */ +sentryTest('LCP >= (FCP, FP)', async ({ browserName, getLocalTestPath, page }) => { + // Only run in chromium to ensure all vitals are present + if (shouldSkipTracingTest() || browserName !== 'chromium') { + sentryTest.skip(); + } + + page.route('**', route => route.continue()); + page.route('**/path/to/image.png', async (route: Route) => { + return route.fulfill({ path: `${__dirname}/assets/sentry-logo-600x179.png` }); + }); + + const url = await getLocalTestPath({ testDir: __dirname }); + const [eventData] = await Promise.all([ + getFirstSentryEnvelopeRequest(page), + page.goto(url), + page.locator('button').click(), + page.waitForTimeout(2000), + ]); + + expect(eventData.measurements).toBeDefined(); + + const lcpValue = eventData.measurements?.lcp?.value; + const fcpValue = eventData.measurements?.fcp?.value; + const fpValue = eventData.measurements?.fp?.value; + + expect(lcpValue).toBeDefined(); + expect(fcpValue).toBeDefined(); + expect(fpValue).toBeDefined(); + + // Assumption: The browser can render at 60FPS which equals 1 frame every 16.6ms. + // Rounded up, 20ms seems like a reasonable margin of error. + const epsilon = 20; + + // LCP >= (FCP, FP) + expect(lcpValue).toBeGreaterThanOrEqual(fcpValue! - epsilon); + expect(lcpValue).toBeGreaterThanOrEqual(fpValue! - epsilon); +}); diff --git a/packages/browser-utils/src/metrics/browserMetrics.ts b/packages/browser-utils/src/metrics/browserMetrics.ts index b71f80df1ff2..b4127314449b 100644 --- a/packages/browser-utils/src/metrics/browserMetrics.ts +++ b/packages/browser-utils/src/metrics/browserMetrics.ts @@ -354,25 +354,6 @@ export function addPerformanceEntries(span: Span, options: AddPerformanceEntries if (op === 'pageload') { _addTtfbRequestTimeToMeasurements(_measurements); - ['fcp', 'fp', 'lcp'].forEach(name => { - const measurement = _measurements[name]; - if (!measurement || !transactionStartTime || timeOrigin >= transactionStartTime) { - return; - } - // The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin. - // Unfortunately, timeOrigin is not captured within the span span data, so these web vitals will need - // to be adjusted to be relative to span.startTimestamp. - const oldValue = measurement.value; - const measurementTimestamp = timeOrigin + msToSec(oldValue); - - // normalizedValue should be in milliseconds - const normalizedValue = Math.abs((measurementTimestamp - transactionStartTime) * 1000); - const delta = normalizedValue - oldValue; - - DEBUG_BUILD && logger.log(`[Measurements] Normalized ${name} from ${oldValue} to ${normalizedValue} (${delta})`); - measurement.value = normalizedValue; - }); - const fidMark = _measurements['mark.fid']; if (fidMark && _measurements['fid']) { // create span for FID @@ -399,7 +380,10 @@ export function addPerformanceEntries(span: Span, options: AddPerformanceEntries setMeasurement(measurementName, measurement.value, measurement.unit); }); - _tagMetricInfo(span); + // Set timeOrigin which denotes the timestamp which to base the LCP/FCP/FP/TTFB measurements on + span.setAttribute('web-vitals.timeOrigin', timeOrigin); + + _setWebVitalAttributes(span); } _lcpEntry = undefined; @@ -604,7 +588,7 @@ function _trackNavigator(span: Span): void { } /** Add LCP / CLS data to span to allow debugging */ -function _tagMetricInfo(span: Span): void { +function _setWebVitalAttributes(span: Span): void { if (_lcpEntry) { DEBUG_BUILD && logger.log('[Measurements] Adding LCP Data'); From 6e29e4d1c570610e8c51475749438d25be7080da Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 28 Aug 2024 17:01:11 +0200 Subject: [PATCH 2/6] remove unstable test, maybe unflake unrelated lcp test? --- .../web-vitals-relations/template.html | 2 +- .../metrics/web-vitals-relations/test.ts | 50 +------------------ .../create-remix-app-v2/app/entry.client.tsx | 9 +++- 3 files changed, 10 insertions(+), 51 deletions(-) diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/template.html b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/template.html index caf4b8f2deab..d4c01b121bf7 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/template.html +++ b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/template.html @@ -5,7 +5,7 @@
- + diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/test.ts b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/test.ts index e4dc773ec48c..c10da02134ba 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/test.ts @@ -19,7 +19,7 @@ sentryTest('paint web vitals values are greater than TTFB', async ({ browserName } page.route('**', route => route.continue()); - page.route('**/path/to/image.png', async (route: Route) => { + page.route('**/library/image.png', async (route: Route) => { return route.fulfill({ path: `${__dirname}/assets/sentry-logo-600x179.png` }); }); @@ -28,8 +28,6 @@ sentryTest('paint web vitals values are greater than TTFB', async ({ browserName getFirstSentryEnvelopeRequest(page), page.goto(url), page.locator('button').click(), - page.waitForTimeout(2000), - // page.waitForFunction(() => {}), ]); expect(eventData.measurements).toBeDefined(); @@ -60,49 +58,3 @@ sentryTest('paint web vitals values are greater than TTFB', async ({ browserName expect(fcpValue).toBeGreaterThanOrEqual(ttfbValue!); expect(fpValue).toBeGreaterThanOrEqual(ttfbValue!); }); - -/** - * Continuing the theme of odd tests, in this one, we check that LCP is greater or equal to FCP and FP. - * - * The problem: There are cases where for _some reason_ the browser reports lower LCP than FCP/FP values :( - * This might have to do with timing inaccuracies in the browser or with some weird bug in the PerformanceObserver - * or Web vitals library. While this shouldn't happen, checking that they're not _vastly_ off is at least better - * than not checking at all, so we factor in a margin of error. - */ -sentryTest('LCP >= (FCP, FP)', async ({ browserName, getLocalTestPath, page }) => { - // Only run in chromium to ensure all vitals are present - if (shouldSkipTracingTest() || browserName !== 'chromium') { - sentryTest.skip(); - } - - page.route('**', route => route.continue()); - page.route('**/path/to/image.png', async (route: Route) => { - return route.fulfill({ path: `${__dirname}/assets/sentry-logo-600x179.png` }); - }); - - const url = await getLocalTestPath({ testDir: __dirname }); - const [eventData] = await Promise.all([ - getFirstSentryEnvelopeRequest(page), - page.goto(url), - page.locator('button').click(), - page.waitForTimeout(2000), - ]); - - expect(eventData.measurements).toBeDefined(); - - const lcpValue = eventData.measurements?.lcp?.value; - const fcpValue = eventData.measurements?.fcp?.value; - const fpValue = eventData.measurements?.fp?.value; - - expect(lcpValue).toBeDefined(); - expect(fcpValue).toBeDefined(); - expect(fpValue).toBeDefined(); - - // Assumption: The browser can render at 60FPS which equals 1 frame every 16.6ms. - // Rounded up, 20ms seems like a reasonable margin of error. - const epsilon = 20; - - // LCP >= (FCP, FP) - expect(lcpValue).toBeGreaterThanOrEqual(fcpValue! - epsilon); - expect(lcpValue).toBeGreaterThanOrEqual(fpValue! - epsilon); -}); diff --git a/dev-packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.client.tsx b/dev-packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.client.tsx index 2109aad0a421..2ca105b5656c 100644 --- a/dev-packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.client.tsx +++ b/dev-packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.client.tsx @@ -25,7 +25,14 @@ Sentry.init({ // Session Replay replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. - tunnel: 'http://localhost:3031/', // proxy server + // tunnel: 'http://localhost:3031/', // proxy server + + beforeSendTransaction(transaction) { + console.log('beforeSendTransaction', transaction, transaction.measurements); + return transaction; + }, + + debug: true, }); startTransition(() => { From 89d82c7a221489d34406a18a5c12ea241f069998 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 28 Aug 2024 17:01:56 +0200 Subject: [PATCH 3/6] more unflaking(?) --- .../suites/tracing/metrics/web-vitals-lcp/template.html | 2 +- .../suites/tracing/metrics/web-vitals-lcp/test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-lcp/template.html b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-lcp/template.html index caf4b8f2deab..502f4dde80c2 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-lcp/template.html +++ b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-lcp/template.html @@ -5,7 +5,7 @@
- + diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-lcp/test.ts b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-lcp/test.ts index f79505c6105a..2e215c728ecf 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-lcp/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-lcp/test.ts @@ -11,7 +11,7 @@ sentryTest('should capture a LCP vital with element details.', async ({ browserN } page.route('**', route => route.continue()); - page.route('**/path/to/image.png', async (route: Route) => { + page.route('**/my/image.png', async (route: Route) => { return route.fulfill({ path: `${__dirname}/assets/sentry-logo-600x179.png` }); }); From 40e9cd1f2b4cc70b4766782466822e8a16174061 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 28 Aug 2024 17:55:35 +0200 Subject: [PATCH 4/6] add performance.timeOrigin attribute --- .../assets/sentry-logo-600x179.png | Bin .../template.html | 0 .../test.ts | 21 ++++++++++++++++++ .../create-remix-app-v2/app/entry.client.tsx | 9 +------- .../src/metrics/browserMetrics.ts | 2 +- 5 files changed, 23 insertions(+), 9 deletions(-) rename dev-packages/browser-integration-tests/suites/tracing/metrics/{web-vitals-relations => web-vitals}/assets/sentry-logo-600x179.png (100%) rename dev-packages/browser-integration-tests/suites/tracing/metrics/{web-vitals-relations => web-vitals}/template.html (100%) rename dev-packages/browser-integration-tests/suites/tracing/metrics/{web-vitals-relations => web-vitals}/test.ts (74%) diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/assets/sentry-logo-600x179.png b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals/assets/sentry-logo-600x179.png similarity index 100% rename from dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/assets/sentry-logo-600x179.png rename to dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals/assets/sentry-logo-600x179.png diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/template.html b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals/template.html similarity index 100% rename from dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/template.html rename to dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals/template.html diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/test.ts b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals/test.ts similarity index 74% rename from dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/test.ts rename to dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals/test.ts index c10da02134ba..3ff09a2862c5 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-relations/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals/test.ts @@ -58,3 +58,24 @@ sentryTest('paint web vitals values are greater than TTFB', async ({ browserName expect(fcpValue).toBeGreaterThanOrEqual(ttfbValue!); expect(fpValue).toBeGreaterThanOrEqual(ttfbValue!); }); + +sentryTest('captures time origin as span attribute', async ({ getLocalTestPath, page }) => { + // Only run in chromium to ensure all vitals are present + if (shouldSkipTracingTest()) { + sentryTest.skip(); + } + + const url = await getLocalTestPath({ testDir: __dirname }); + const [eventData] = await Promise.all([getFirstSentryEnvelopeRequest(page), page.goto(url)]); + + const timeOriginAttribute = eventData.contexts?.trace?.data?.['performance.timeOrigin']; + const transactionStartTimestamp = eventData.start_timestamp; + + expect(timeOriginAttribute).toBeDefined(); + expect(transactionStartTimestamp).toBeDefined(); + + const delta = Math.abs(transactionStartTimestamp! - timeOriginAttribute); + + // The delta should be less than 1ms if this flakes, we should increase the threshold + expect(delta).toBeLessThanOrEqual(1); +}); diff --git a/dev-packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.client.tsx b/dev-packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.client.tsx index 2ca105b5656c..2109aad0a421 100644 --- a/dev-packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.client.tsx +++ b/dev-packages/e2e-tests/test-applications/create-remix-app-v2/app/entry.client.tsx @@ -25,14 +25,7 @@ Sentry.init({ // Session Replay replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. - // tunnel: 'http://localhost:3031/', // proxy server - - beforeSendTransaction(transaction) { - console.log('beforeSendTransaction', transaction, transaction.measurements); - return transaction; - }, - - debug: true, + tunnel: 'http://localhost:3031/', // proxy server }); startTransition(() => { diff --git a/packages/browser-utils/src/metrics/browserMetrics.ts b/packages/browser-utils/src/metrics/browserMetrics.ts index b4127314449b..066eba1e6839 100644 --- a/packages/browser-utils/src/metrics/browserMetrics.ts +++ b/packages/browser-utils/src/metrics/browserMetrics.ts @@ -381,7 +381,7 @@ export function addPerformanceEntries(span: Span, options: AddPerformanceEntries }); // Set timeOrigin which denotes the timestamp which to base the LCP/FCP/FP/TTFB measurements on - span.setAttribute('web-vitals.timeOrigin', timeOrigin); + span.setAttribute('performance.timeOrigin', timeOrigin); _setWebVitalAttributes(span); } From 20e12fad88d63cfdaa6466be3ab2f252f34f9c70 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 28 Aug 2024 17:56:54 +0200 Subject: [PATCH 5/6] adjust e2e test --- .../react-create-hash-router/tests/transactions.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/dev-packages/e2e-tests/test-applications/react-create-hash-router/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/react-create-hash-router/tests/transactions.test.ts index 10442a4a2bde..861b6c420fbb 100644 --- a/dev-packages/e2e-tests/test-applications/react-create-hash-router/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-create-hash-router/tests/transactions.test.ts @@ -22,6 +22,7 @@ test('Captures a pageload transaction', async ({ page }) => { 'sentry.origin': 'auto.pageload.react.reactrouter_v6', 'sentry.sample_rate': 1, 'sentry.source': 'route', + 'performance.timeOrigin': expect.any(Number), }, op: 'pageload', span_id: expect.any(String), From 851b31f42567d0528b4892d200108436cba747f9 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 29 Aug 2024 16:11:06 +0200 Subject: [PATCH 6/6] add changelog note --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4fb77f95837..d330fdf29e78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,17 @@ - "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott +### Important Changes + +- **fix(browser): Remove faulty LCP, FCP and FP normalization logic (#13502)** + +This release fixes a bug in the `@sentry/browser` package and all SDKs depending on this package (e.g. `@sentry/react` +or `@sentry/nextjs`) that caused the SDK to send incorrect web vital values for the LCP, FCP and FP vitals. The SDK +previously incorrectly processed the original values as they were reported from the browser. When updating your SDK to +this version, you might experience an increase in LCP, FCP and FP values, which potentially leads to a decrease in your +performance score in the Web Vitals Insights module in Sentry. This is because the previously reported values were +smaller than the actually measured values. We apologize for the inconvenience! + Work in this release was contributed by @leopoldkristjansson and @filips123. Thank you for your contributions! ## 8.27.0