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

fix(performance): Fix LCP not getting picked up on initial pageload transaction by setting reportAllChanges to true #12360

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions packages/browser-utils/src/metrics/instrument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,17 @@ function instrumentFid(): void {
}

function instrumentLcp(): StopListening {
return onLCP(metric => {
triggerHandlers('lcp', {
metric,
});
_previousLcp = metric;
});
return onLCP(
metric => {
triggerHandlers('lcp', {
metric,
});
_previousLcp = metric;
},
// We want the callback to be called whenever the LCP value updates.
// By default, the callback is only called when the tab goes to the background.
{ reportAllChanges: true },
);
}

function instrumentTtfb(): StopListening {
Expand Down
Loading