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.
This PR adds support for instrumenting and sending spans from
ElementTiming
API entries. Just like with web vitals and long tasks/animation frames, we register aPerformanceObserver
and extract spans from newly emitted ET entries.Important:
enableElementTiming: false
inbrowserTracingIntegration
navigation
spans as well). We could also go the route of only sending until the first navigation as with standalone CLS/LCP spans. Happy to accept any direction we wanna take this.Some noteworthy findings while working on this:
loadTime
which is the relative timestamp to the browser'stimeOrigin
, when the image finished loading. For text nodes,loadTime
is always0
, since nothing needs to be loaded.renderTime
which is the relative timestamp to the browser'stimeOrigin
, when the node finished rendering (i.e. was painted by the browser).renderTime - loadTime
for image nodes0
for text nodestimeOrigin + loadTime
for image nodestimeOrigin + renderTime
for text nodesIn addition to the raw span and conventional attributes, we also collect a bunch of ET-specific attributes:
element.type
- tag name of the element (e.g.img
orp
)element.size
- width x height of the elementelement.render-time
-entry.renderTime
element.load-time
-entry.loadTime
element.url
- url of the loaded image (undefined
for text nodes)element.identifier
- the identifier passed to theelementtiming=identifier
HTML attributeelement.paint-type
- the node paint type (image-paint
ortext-paint
)also some additional sentry-sepcific attributes:
route
- the route name, either from the active root span (if available) or from the scope'stransactionName
sentry.span-start-time-source
- the data point we used as the span start timeMore than happy to adjust any of this logic or attribute names, based on review feedback :)
closes #13675
also ref #7292