Skip to content

fix(tracing): Record LCP and CLS on transaction finish - #7386

Merged
AbhiPrasad merged 4 commits into
developfrom
abhi-force-finish-lcp
Mar 9, 2023
Merged

fix(tracing): Record LCP and CLS on transaction finish#7386
AbhiPrasad merged 4 commits into
developfrom
abhi-force-finish-lcp

Conversation

@AbhiPrasad

@AbhiPrasadAbhiPrasad commented Mar 8, 2023

Copy link
Copy Markdown
Contributor

fixes#7341

To get better LCP and CLS accuracy, let's fire the stopListening func on transaction finish.

@AbhiPrasad
AbhiPrasad requested a review from k-fishMarch 8, 2023 17:27
@AbhiPrasad
AbhiPrasad marked this pull request as ready for review March 8, 2023 17:28
@github-actions

github-actionsBot commented Mar 8, 2023

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@sentry/browser - ES5 CDN Bundle (gzipped + minified)20.21 KB (-0.01% 🔽)
@sentry/browser - ES5 CDN Bundle (minified)62.89 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified)18.85 KB (-0.01% 🔽)
@sentry/browser - ES6 CDN Bundle (minified)55.8 KB (0%)
@sentry/browser - Webpack (gzipped + minified)20.6 KB (0%)
@sentry/browser - Webpack (minified)67.32 KB (0%)
@sentry/react - Webpack (gzipped + minified)20.62 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified)48.51 KB (+0.11% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified)27.49 KB (+0.14% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified)25.74 KB (+0.14% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified)43.17 KB (-0.01% 🔽)
@sentry/replay - Webpack (gzipped + minified)37.19 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified)61.16 KB (+0.06% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified)54.33 KB (-0.01% 🔽)

Comment on lines +43 to +45
_trackCLS();
_trackLCP();
_trackFID();
return _trackLCP();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does CLS also have a stop listen? we should be returning all of them in a wrapper function and just settling them whenever we finish the transaction

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that makes sense to me, will make the change.

@AbhiPrasadAbhiPrasad changed the title fix(tracing): Record LCP on transaction finishfix(tracing): Record LCP and CLS on transaction finishMar 9, 2023
@AbhiPrasad
AbhiPrasad merged commit 1d6d216 into developMar 9, 2023
@AbhiPrasad
AbhiPrasad deleted the abhi-force-finish-lcp branch March 9, 2023 10:12
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing LCP/CLS measurements

2 participants

@AbhiPrasad@k-fish