When a user visits a page on your website, a new RUM view event is created. The view contains live page load and performance metrics. Performance metrics are sent to Datadog periodically as the page finishes loading and might be empty for a few seconds before they appear in the Datadog UI.
To find what’s causing a page to under-perform:
Performance metrics are collected for each individual view. These metrics can pinpoint exactly where the problem is occurring when used with the RUM context collected by default (current page view information, GeoIP data, browser information, etc.) and extended with Global Context.
These performance metrics are key for helping you start your investigations:
For information about the default attributes for all RUM event types, see Data Collected. For information about configuring for sampling, global context, or custom user actions, see Advanced Configuration. The following table lists Datadog-specific metrics along with performance metrics collected from Navigation Timing API and Paint Timing API:
|number (ns)||Time spent on the current view.|
|number (ns)||Time until the page is ready and no network request or DOM mutation is currently occurring. More info.|
|number (ns)||Time when the browser first renders any text, image (including background images), non-white canvas, or SVG. For more information about browser rendering, see the w3 definition.|
|number (ns)||The moment when the parser finishes its work on the main document. More info from the MDN documentation|
|number (ns)||Event fired when the initial HTML document is completely loaded and parsed, without waiting for non-render blocking stylesheets, images, and subframes to finish loading. More info from the MDN documentation.|
|number (ns)||The page and all the subresources are ready. For the user, the loading spinner has stopped spinning. More info from the MDN documentation|
|number (ns)||Event fired when the page is fully loaded. Usually a trigger for additional application logic. More info from the MDN documentation|
|number||Count of all errors collected for this view.|
|number||Count of all long tasks collected for this view.|
|number||Count of all resources collected for this view.|
|number||Count of all actions collected for this view.|
For Single Page Applications (SPAs), the RUM SDK differentiates between
route_change navigation with the
loading_type attribute. If a click on your web page leads to a new page without a full refresh of the page, the RUM SDK starts a new view event with
loading_type:route_change. RUM tracks page changes using the History API.
Datadog provides a unique performance metric,
loading_time, which calculates the time needed for a page to load. This metric works for both
To account for modern web applications, loading time watches for network requests and DOM mutations.
Initial Load: Loading Time is equal to whichever is longer:
navigationStartand the first time the page has no activity for more than 100ms (activity defined as ongoing network requests or a DOM mutation).
SPA Route Change: Loading Time is equal to the difference between the user click and the first time the page has no activity for more than 100ms (activity defined as ongoing network requests or a DOM mutation).
The RUM SDK automatically monitors frameworks that rely on hash (
#) navigation. The SDK watches for
HashChangeEvent and issues a new view. Events coming from an HTML anchor tag which do not affect the current view context are ignored.