Information collected by the CloudWatch RUM web client - Amazon CloudWatch
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Information collected by the CloudWatch RUM web client

This section documents the PutRumEvents schema, which defines the structure of the data that you can collect from user sessions using CloudWatch RUM.

A PutRumEvents request sends a data structure with the following fields to CloudWatch RUM.

  • The ID of this batch of RUM events

  • App monitor details, which includes the following:

    • App monitor ID

    • Monitored application version

  • User details, which includes the following. This is collected only if the app monitor has cookies enabled.

    • A user ID generated by the web client

    • Session ID

  • The array of RUM events in this batch.

RUM event schema

The structure of each RUM event includes the following fields.

RUM event metadata

The metadata includes page metadata, user agent metadata, geolocation metadata, and domain metadata.

Page metadata

The page metadata includes the following:

  • Page ID

  • Page title

  • Parent page ID. – This is collected only if the app monitor has cookies enabled.

  • Interaction depth – This is collected only if the app monitor has cookies enabled.

  • Page tags – You can add tags to page events to group pages together. For more information, see Use page groups.

User agent metadata

The user agent metadata includes the following:

  • Browser language

  • Browser name

  • Browser version

  • Operating system name

  • Operating system version

  • Device type

  • Platform type

Geolocation metadata

The geolocation metadata includes the following:

  • Country code

  • Subdivision code

Domain metadata

The domain metadata includes the URL domain.

RUM event details

The details of an event follow one of the following type of schemas, depending on the event type.

Session start event

This event contains no fields. This is collected only if the app monitor has cookies enabled.

Page view schema

A Page view event contains the following properties. You can deactivate page view collection by configuring the web client. For more information, see the CloudWatch RUM web client documentation.

Name Type Description

Page ID

String

An ID that uniquely represents this page within the application. By default, this is the URL path.

Parent page ID

String

The ID of the page that the user was on when they navigated to the current page. This is collected only if the app monitor has cookies enabled.

Interaction depth

String

This is collected only if the app monitor has cookies enabled.

JavaScript error schema

JavaScript error events generated by the agent contain the following properties. The web client collects these events only if you selected to collect the errors telemetry.

Name Type Description

Error type

String

The error's name, if one exists. For more information, see Error.prototype.name.

Some browsers might not support error types.

Error message

String

The error's message. For more information, see Error.prototype.message. If the error field does not exist, this is the message of the error event. For more information, see ErrorEvent.

Error messages might not be consistent across different browsers.

Stack trace

String

The error's stack trace, if one exists, truncated to 150 characters. For more information, see Error.prototype.stack.

Some browsers might not support stack traces.

DOM event schema

Document object model (DOM) events generated by the agent contain the following properties. These events are not collected by default. They are collected only if you activate the interactions telemetry. For more information, see the CloudWatch RUM web client documentation.

Name Type Description

Event

String

The type of DOM event, such as click, scroll, or hover. For more information, see Event reference.

Element

String

The DOM element type

Element ID

String

If the element that generated the event has an ID, this property stores that ID. For more information, see Element.id.

CSSLocator

String

The CSS locator used to identify the DOM element.

InteractionId

String

A unique ID for the interaction between the user and the UI.

Navigation event schema

Navigation events are collected only if the app monitor has performance telemetry activated.

Navigation events use Navigation timing Level 1 and Navigation timing Level 2 APIs. Level 2 APIs are not supported on all browsers, so these newer fields are optional.

Note

Timestamp metrics are based on DOMHighResTimestamp. With Level 2 APIs, all timings are by default relative to the startTime. But for Level 1, the navigationStart metric is subtracted from timestamp metrics to obtain relative values. All timestamp values are in milliseconds.

Navigation events contain the following properties.

Name Type Description Notes

initiatorType

String

Represents the type of resource that initiated the performance event.

Value: "navigation"

Level 1: "navigation"

Level 2: entryData.initiatorType

navigationType

String

Represents the type of navigation.

This attribute is not required.

Value: The value must be one of the following:

  • navigate is a navigation started by choosing a link, entering a URL in a browser's address bar, form submission, or initializing through a script operation other than reload or back_forward .

  • reload is a navigation through the browser's reload operation or location.reload() .

  • back_forward is a navigation through the browser's history traversal operation.

  • prerender is a navigation initiated by a prerender hint. For more information, see Prerender.

startTime

Number

Indicates when the event is triggered.

Value: 0

Level 1: entryData.navigationStart - entryData.navigationStart

Level 2: entryData.startTime

unloadEventStart

Number

Indicates the time when the previous document in the window began to unload after the unload event was thrown.

Value: If there is no previous document or if the previous document or one of the needed redirects is not of the same origin, the value returned is 0.

Level 1:

entryData.unloadEventStart > 0 ? entryData.unloadEventStart - entryData.navigationStart : 0

Level 2: entryData.unloadEventStart

promptForUnload

Number

The time taken to unload the document. In other words, the time between unloadEventStart and unloadEventEnd. UnloadEventEnd represents the moment in milliseconds when the unload event handler finishes.

Value: If there is no previous document or if the previous document or one of the needed redirects is not of the same origin, the value returned is 0.

Level 1: entryData.unloadEventEnd - entryData.unloadEventStart

Level 2: entryData.unloadEventEnd - entryData.unloadEventStart

redirectCount

Number

A number representing the number of redirects since the last non-redirect navigation under the current browsing context.

This attribute is not required.

Value: If there is no redirect or if there is any redirect that is not of the same origin as the destination document, the value returned is 0.

Level 1: Not available

Level 2: entryData.redirectCount

redirectStart

Number

The time when the first HTTP redirect starts.

Value: If there is no redirect or if there is any redirect that is not of the same origin as the destination document, the value returned is 0.

Level 1:

entryData.redirectStart > 0 ? entryData.redirectStart - entryData.navigationStart : 0

Level 2: entryData.redirectStart

redirectTime

Number

The time taken for the HTTP redirect. This is the difference between redirectStart and redirectEnd.

Level 1: : entryData.redirectEnd - entryData.redirectStart

Level 2: : entryData.redirectEnd - entryData.redirectStart

workerStart

Number

This is a property of the PerformanceResourceTiming interface. It marks the beginning of worker thread operation.

This attribute is not required.

Value: If a Service Worker thread is already running, or immediately before starting the Service Worker thread, this property returns the time immediately before dispatching FetchEvent. It returns 0 if the resource is not intercepted by a Service Worker.

Level 1: Not available

Level 2: entryData.workerStart

workerTime

Number

If the resource is intercepted by a Service Worker, this returns the time required for worker thread operation.

This attribute is not required.

Level 1: Not available

Level 2:

entryData.workerStart > 0 ? entryData.fetchStart - entryData.workerStart : 0

fetchStart

Number

The time when the browser is ready to fetch the document using an HTTP request. This is before checking any application cache.

Level 1:

: entryData.fetchStart > 0 ? entryData.fetchStart - entryData.navigationStart : 0

Level 2: entryData.fetchStart

domainLookupStart

Number

The time when the domain lookup starts.

Value: If a persistent connection is used or if the information is stored in a cache or local resource, the value will be the same as fetchStart.

Level 1:

entryData.domainLookupStart > 0 ? entryData.domainLookupStart - entryData.navigationStart : 0

Level 2: entryData.domainLookupStart

dns

Number

The time required for domain lookup.

Value: If the resources and DNS records are cached, the expected value is 0.

Level 1: entryData.domainLookupEnd - entryData.domainLookupStart

Level 2: entryData.domainLookupEnd - entryData.domainLookupStart

nextHopProtocol

String

A string representing the network protocol used to fetch the resource.

This attribute is not required.

Level 1: Not available

Level 2: entryData.nextHopProtocol

connectStart

Number

The time immediately before the user agent starts establishing the connection to the server to retrieve the document.

Value: If an RFC2616 persistent connection is used, or if the current document is retrieved from relevant application caches or local resources, this attribute returns the value of domainLookupEnd.

Level 1:

entryData.connectStart > 0 ? entryData.connectStart - entryData.navigationStart : 0

Level 2: entryData.connectStart

connect

Number

Measures the time required to establish the transport connections or to perform SSL authentication. It also includes the blocked time that is taken when there are too many concurrent requests issued by the browser.

Level 1: entryData.connectEnd - entryData.connectStart

Level 2: entryData.connectEnd - entryData.connectStart

secureConnectionStart

Number

If the URL scheme of the current page is "https", this attribute returns the time immediately before the user agent starts the handshake process to secure the current connection. It returns 0 if HTTPS is not used. For more information about URL schemes, see URL representation.

Formula: entryData.secureConnectionStart

tlsTime

Number

The time taken to complete an SSL handshake.

Level 1:

entryData.secureConnectionStart > 0 ? entryData.connectEnd - entryData.secureConnectionStart : 0

Level 2:

entryData.secureConnectionStart > 0 ? entryData.connectEnd - entryData.secureConnectionStart : 0

requestStart

Number

The time immediately before the user agent starts requesting the resource from the server, or from relevant application caches, or from local resources.

Level 1:

: entryData.requestStart > 0 ? entryData.requestStart - entryData.navigationStart : 0

Level 2: entryData.requestStart

timeToFirstByte

Number

The time taken to receive the first byte of information after a request is made. This time is relative to the startTime.

Level 1: entryData.responseStart - entryData.requestStart

Level 2: entryData.responseStart - entryData.requestStart

responseStart

Number

The time immediately after the user agent's HTTP parser receives the first byte of the response from the relevant application caches, or from local resources, or from the server.

Level 1:

entryData.responseStart > 0 ? entryData.responseStart - entryData.navigationStart : 0

Level 2: entryData.responseStart

responseTime

String

The time taken to receive a complete response in the form of bytes from the relevant application caches, or from local resources, or from the server.

Level 1:

entryData.responseStart > 0 ? entryData.responseEnd - entryData.responseStart : 0

Level 2:

entryData.responseStart > 0 ? entryData.responseEnd - entryData.responseStart : 0

domInteractive

Number

The time when the parser finished its work on the main document, and the HTML DOM is constructed. At this time, its Document.readyState changes to "interactive" and the corresponding readystatechange event is thrown.

Level 1:

entryData.domInteractive > 0 ? entryData.domInteractive - entryData.navigationStart : 0

Level 2: entryData.domInteractive

domContentLoadedEventStart

Number

Represents the time value equal to the time immediately before the user agent fires the DOMContentLoaded event at the current document. TheDOMContentLoaded event fires when the initial HTML document has been completely loaded and parsed. At this time, the main HTML document has finished parsing, the browser begins constructing the render tree, and subresources still have to be loaded. This does not wait for style sheets, images, and subframes to finish loading.

Level 1:

entryData.domContentLoadedEventStart > 0 ? entryData.domContentLoadedEventStart - entryData.navigationStart : 0

Level 2: entryData.domContentLoadedEventStart

domContentLoaded

Number

This start and end time of render tree construction is marked by the domContentLoadedEventStart and domContentLoadedEventEnd. It lets CloudWatch RUM track execution. This property is the difference between domContentLoadedStart and domContentLoadedEnd.

During this time, DOM and CSSOM are ready. This property waits on script execution, except for asynchronous and dynamically created scripts. If the scripts depend on style sheets, domContentLoaded waits on the style sheets, too. It does not wait on images.

Note

The actual values of domContentLoadedStart and domContentLoadedEnd approximate to domContentLoaded in Google Chrome's Network panel. It indicates HTML DOM + CSSOM render tree construction time from the beginning of the page loading process. In the case of navigation metrics, the domContentLoaded value represents the difference between start and end values, which is the time required for downloading subresources and render-tree construction only.

Level 2: entryData.domContentLoadedEventEnd - entryData.domContentLoadedEventStart

Level 2: entryData.domContentLoadedEventEnd - entryData.domContentLoadedEventStart

domComplete

Number

The time immediately before the browser sets the current document readiness of the current document to complete. At this point, the loading of subresources, such as images, is complete. This includes the time taken for downloading blocking content such as CSS and synchronous JavaScript. This approximates to loadTime in Google Chrome’s Network panel.

Level 1:

entryData.domComplete > 0 ? entryData.domComplete - entryData.navigationStart : 0

Level 2: entryData.domComplete

domProcessingTime

Number

The total time between the response and the load event start.

Level 1: entryData.loadEventStart - entryData.responseEnd

Level 2: entryData.loadEventStart - entryData.responseEnd

loadEventStart

Number

The time immediately before the load event of the current document is fired.

Level 1:

entryData.loadEventStart > 0 ? entryData.loadEventStart - entryData.navigationStart : 0

Level 2: entryData.loadEventStart

loadEventTime

Number

The difference between loadEventStart and loadEventEnd. Additional functions or logic waiting for this load event will be fired during this time.

Level 1: entryData.loadEventEnd - entryData.loadEventStart

Level 2: entryData.loadEventEnd - entryData.loadEventStart

duration

String

Duration is the total page load time. It records the timing for downloading the main page and all of its synchronous subresources, and also for rendering the page. Asynchronous resources such as scripts continue to download later. This is the difference between the loadEventEnd and startTime properties.

Level 1: entryData.loadEventEnd - entryData.navigationStart

Level 2: entryData.duration

headerSize

Number

Returns the difference between transferSize and encodedBodySize.

This attribute is not required.

Level 1: Not available

Level 2: entryData.transferSize - entryData.encodedBodySize

Level 2: entryData.transferSize - entryData.encodedBodySize

compressionRatio

Number

The ratio of encodedBodySize and decodedBodySize. The value of encodedBodySize is the compressed size of the resource excluding the HTTP headers. The value of decodedBodySize is the decompressed size of the resource excluding the HTTP headers.

This attribute is not required.

Level 1: Not available.

Level 2:

entryData.encodedBodySize > 0 ? entryData.decodedBodySize / entryData.encodedBodySize : 0

navigationTimingLevel

Number

The navigation timing API version.

Value: 1 or 2

Resource event schema

Resource events are collected only if the app monitor has performance telemetry activated.

Timestamp metrics are based on The DOMHighResTimeStamp typedef. With Level 2 APIs, by default all timings are relative to the startTime. But for Level 1 APIs, the navigationStart metric is subtracted from timestamp metrics to obtain relative values. All timestamp values are in milliseconds.

Resource events generated by the agent contain the following properties.

Name Type Description Notes

targetUrl

String

Returns the resource's URL.

Formula: entryData.name

initiatorType

String

Represents the type of resource that initiated the performance resource event.

Value: "resource"

Formula: entryData.initiatorType

duration

String

Returns the difference between the responseEnd and startTime properties.

This attribute is not required.

Formula: entryData.duration

transferSize

Number

Returns the size (in octets) of the fetched resource, including the response header fields and the response payload body.

This attribute is not required.

Formula: entryData.transferSize

fileType

String

Extensions derived from the target URL pattern.

Largest contentful paint event schema

Largest contentful paint events contain the following properties.

These events are collected only if the app monitor has performance telemetry activated.

Name Description

Value

For more information, see Web Vitals.

First input delay event

First input delay events contain the following properties.

These events are collected only if the app monitor has performance telemetry activated.

Name Description

Value

For more information, see Web Vitals.

Cumulative layout shift event

Cumulative layout shift events contain the following properties.

These events are collected only if the app monitor has performance telemetry activated.

Name Description

Value

For more information, see Web Vitals.

HTTP event

HTTP events can contain the following properties. It will contain either a Response field or an Error field, but not both.

These events are collected only if the app monitor has HTTP telemetry activated.

Name Description

Request

The request field includes the following:

  • The Method field, which can have values such as GET, POST, and so on.

  • The URL

Response

The response field includes the following:

  • Status, such as 2xx, 4xx, or 5xx

  • Status text

Error

The error field includes the following:

  • Type

  • Message

  • File name

  • Line number

  • Column number

  • Stack trace

X-Ray trace event schema

These events are collected only if the app monitor has X-Ray tracing activated.

For information about X-Ray trace event schemas, see Amazon X-Ray segment documents.