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

ref(tracing): Remove mark measurements #5605

Merged
merged 1 commit into from Aug 19, 2022
Merged

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Aug 18, 2022

Ref getsentry/sentry#38023

fixes https://getsentry.atlassian.net/browse/PERF-1700

https://www.notion.so/sentry/Stop-sending-mark-X-measurements-from-JavaScript-SDK-66d26d45e860419280ec853377195305

Currently the JS SDK sends extra measurements though, specifically mark.lcp, mark.fid, mark.fp, mark.fcp. This is done because these measurements are being used in the Sentry front-end UI to draw these lines:

image

These measurements should be removed, as they count toward a user’s custom measurement quota - hence we would be reducing the amount of custom measurements they can send and use because the SDK is setting them automatically. In addition, there is no way these measurements are ever going to be indexed, so we can’t move them to be built-in.

To remove these mark.X measurements, we’ll need to first adjust the Sentry front-end UI to stop using them, and then delete them from the SDK.

@0Calories

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.41 KB (0%)
@sentry/browser - ES5 CDN Bundle (minified) 60.06 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 17.98 KB (+0.02% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 52.92 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 19.77 KB (0%)
@sentry/browser - Webpack (minified) 64.31 KB (0%)
@sentry/react - Webpack (gzipped + minified) 19.79 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 44.7 KB (-0.05% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.9 KB (-0.08% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.27 KB (-0.06% 🔽)

});

// Delete mark.fid as we don't want it to be part of final payload
delete _measurements['mark.fid'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to delete it at the end here? Can't we just remove the line that sets mark.fid on _measurements?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nevermind, this is kind of a nit. It's being used to calculate the duration of the FID span but the way we're doing it now with this pattern seems a bit weird to me

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah it's not the cleanest, but it is the most bundle size efficient to keep it in the same object instead of constructing a new variable.

tbh it's even worth considering if the FID span is that valuable - i don't really think it is, but that's a convo for another time.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, keeping the bundle size down is important!

Agreed on the lack of value of the FID span, I think it is redundant since we're already saving it as a measurement, but yes we can discuss more on this later

@AbhiPrasad AbhiPrasad merged commit f563eae into master Aug 19, 2022
@AbhiPrasad AbhiPrasad deleted the abhi-mark-measurements branch August 19, 2022 20:01
@lforst
Copy link
Member

lforst commented Aug 30, 2022

Are the lines still there? @smeubank wants to know

@0Calories
Copy link
Contributor

@lforst Yep, we refactored the frontend so we will still have the lines even without the mark measurements 👍

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

3 participants