feat(browser): Add navigation activationStart
timestamp to pageload span
#13658
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In prerendering scenarios, where a page might be prefetched and pre-rendered before the user clicks a link, the performance API starts measuring the navigation earlier than when the user clicks it. Web Vital measurements however are always based on the user-perceived (loading) time, so they are not reported from the actual start of the navigation, but rather from the time where the user actively started the navigation, for example by clicking a link. This user action is called "activation" and the time between navigation start and activation is stored in the
activationStart
attribute of the "navigation" PerformanceEntry.This PR adds this
activationStart
property as it gets reported by the browser asperformance.activationStart
span attribute to the pageload span. The browser gives us a relative time in ms, based on thestartTime
attribute. ThestartTime
attribute is always 0 for navigation entry but in absolute numbers, it corresponds toperformance.timeOrigin
(which we already send as a span attribute since #13502). So if necessary, in the product, we can calculate the absolute timestamp viaperformance.timeOrigin + performance.activationStart
.We can use this attribute as a heuristic where to draw the vertical web vital lines for TTFB, LCP (and possibly FCP) from.