Skip to content

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Sep 26, 2025

When there's no layout shift, the standalone CLS span would previously have the same start time as the pageload span (performance.timeOrigin). This caused the cls span to be incorrectly interpreted as the trace root in the Sentry UI. We can fix this by setting the span start timestamp as the startTime instead if there's no layout shift. In all other cases, we let the span start at the time the last CLS update occured.

@Lms24 Lms24 self-assigned this Sep 26, 2025
@Lms24 Lms24 changed the title fix(browser): Use current CLS span start timestamp when CLS is 0 fix(browser): Use current start timestamp for CLS span when CLS is 0 Sep 26, 2025
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser.cls',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.webvital.cls',
[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: entry?.duration || 0,
[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: 0,
Copy link
Member Author

Choose a reason for hiding this comment

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

those were just useless bytes. duration is always zero for CLS

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.

1 participant