Skip to content
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

feat(replay): Change LCP calculation #7187

Merged
merged 3 commits into from Feb 16, 2023
Merged

Conversation

billyvg
Copy link
Member

@billyvg billyvg commented Feb 14, 2023

Fixes up calculating LCP timing based on web-vitals. Previously we were using the duration field on the PerformanceEntry, but it was always 0.

Decided to change the data.duration field to data.value so that we do not break the frontend when trying to display this new field.

Fixes up calculating LCP timing based on `web-vitals`. Previously we were using the `duration` field on the PerformanceEntry, but it was always 0.

Decided to change the `data.duration` field to `data.value` so that we do not break the frontend when trying to display this new field.
@billyvg
Copy link
Member Author

billyvg commented Feb 14, 2023

The frontend currently calculates its own duration using start replay timestamp and LCP end timestamp (which == start timestamp). So any following LCP entries (e.g. after a refresh) will be incorrect.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.08 KB (-0.01% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 62.23 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.71 KB (-0.01% 🔽)
@sentry/browser - ES6 CDN Bundle (minified) 55.37 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.44 KB (0%)
@sentry/browser - Webpack (minified) 66.81 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.47 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.9 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 27.03 KB (-0.01% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.29 KB (-0.01% 🔽)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 42.57 KB (+0.12% 🔺)
@sentry/replay - Webpack (gzipped + minified) 36.78 KB (+0.16% 🔺)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 60.3 KB (+0.09% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 53.83 KB (+0.1% 🔺)

@billyvg billyvg marked this pull request as ready for review February 16, 2023 16:09
@billyvg billyvg merged commit 8305b94 into develop Feb 16, 2023
@billyvg billyvg deleted the feat-replay-fix-lcp-duration branch February 16, 2023 20:26
billyvg added a commit to getsentry/sentry that referenced this pull request Feb 17, 2023
Due to 7.38.0 (getsentry/sentry-javascript#7187) LCP endtimestamp was being incorrectly recorded. The end timestamp is used in our UI to calculate duration at the moment, so LCP with high values are causing our calculated duration to be incorrect. Ignore LCP in the duration calculation as a temporary fix. Ideally we would get SDK timestamps correct so that we only have the event duration as the source of truth for duration.
billyvg added a commit to getsentry/sentry that referenced this pull request Feb 17, 2023
Due to 7.38.0 (getsentry/sentry-javascript#7187)
LCP endtimestamp was being incorrectly recorded. The end timestamp is
used in our UI to calculate duration at the moment, so LCP with high
values are causing our calculated duration to be incorrect. Ignore LCP
in the duration calculation as a temporary fix. Ideally we would get SDK
timestamps correct so that we only have the event duration as the source
of truth for duration.
Sign up for free to 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.

None yet

2 participants