• /
  • EnglishEspañol日本語한국어Português
  • ログイン今すぐ開始

Browser monitoring and performance impact

The 's JavaScript snippet introduces a nearly invisible impact on website performance and user perception of the time it takes a page to load. The JavaScript is included in a packet of webpage data that is sent anyway. In addition, it immediately begins monitoring for errors and events as the rest of the webpage executes. The negligible amount of overhead required to load the JavaScript results in a significant return of actionable data.

Overall impact

The JavaScript's overhead takes into consideration both the impact on the user and the impact on your systems' performance:

  • User perception: Typically users cannot detect performance degradations on a website of less than 200ms. Browser's JavaScript adds less than 15ms in aggregated time per page load. This is split up over time, so at no point would a user be able to perceive any performance impact due to the JavaScript.
  • Webserver and systems: Browser app monitoring occurs on the user's browser, not on the server. Processing time does not have an impact on your CPU consumption.

In addition, we take additional steps to minimize any potential impact on the apps and webpages being monitored. For example, the "loader" script is loaded synchronously in the <HEAD> in order to ensure monitoring is enabled for the entire life cycle of the page. This script is included inline, which eliminates the need for another roundtrip network request to a content delivery network (CDN). The "loader" comes with the initial page load.

Later in the life cycle of the page, New Relic loads additional monitoring scripts asynchronously. These scripts should not have any perceivable effect to the user and is included in the overall overhead of less than 15ms per page.

Network impact

Browser monitoring also minimizes network traffic for the end user by aggregating data locally (in the client) and sending it back to New Relic at periodic intervals and on page lifecycle events load, unload, pageshow, and pagehide. (During the browser session's idle periods, transmissions may not be required.)

Browser agent scripts

The agent consists of multiple scripts to reduce the initial size of the "loader" and to support loading only the JavaScript necessary to support the agent features that are enabled. The first script, the "loader", is inserted inline into the HTML document. The remaining scripts are downloaded from the content delivery network (js-agent.newrelic.com) when the load page lifecycle event happens. The number of scripts loaded is dependent upon the type of agent being use. Find out about browser agent types here.

Script

Lite

Pro

Pro + SPA

Inline script size

10.2 kB

15.5 kB

17.5 kB

Downloaded script size

15.3 kB

21 kB

25.4 kB

Sizes are based on minified scripts using gzip compression.

Browser agent harvests

Data type

Lite

Pro

Pro + SPA

Harvest frequency

PageView events

yes

yes

yes

PageView events are harvested once immediately after the load page lifecycle event. This data is responsible for generating the page view metrics in the New Relic UI Browser dashboard. This is a JSONP call to bam.nr-data.net or bam-cell.nr-data.net. All agents are required to collect a PageView event.

PageViewTiming events

yes

yes

yes

PageViewTiming events are harvested by all agents and includes timing data like core web vitals measurements. The first harvest happens 10 seconds after the load page lifecycle event. Additional harvests occur every 30 seconds as needed when there's data to send. See the PageViewTiming docs for a list of reported events.

JavaScriptError metrics

no

yes

yes

JavaScriptError metrics are harvested every 10 seconds after the load page lifecycle event. This harvest is sent as metric timeslice data and also includes the Ajax metrics.

Ajax metrics

no

yes

yes

Sent together with JavaScriptError metrics as timeslice data.

AjaxRequest events

no

yes

yes

AjaxRequest events are harvested every 10 seconds after the load page lifecycle event unless the SPA agent is in use. If using the SPA agent, the first harvest will happen after the load page lifecycle event. Subsequent harvests will either happen every 10 seconds or when the SPA agent notices a route change.

Session traces

no

yes

yes

Session trace data is harvested after the load page lifecycle event. Subsequent harvest happen every 10 seconds if enough data has been collected. Session traces send the most data, but they are heavily sampled. Only about 75 page views per hour get enabled to send session trace data.

Session replay

no

yes

yes

Session replay events are harvested when one of the following occurs:

  • When the compressed data collected for the session reaches a maximum size of 64 KB.

  • If the user remains on the same page for more than 60 seconds.

  • When visibility of the page changes (tab change, focus, navigation, etc)

    The endpoint can differ depending on the locale, but an example for US would be https://bam.nr-data.net/browser/blobs.

PageAction events

no

yes

yes

PageAction events are harvested after the load page lifecycle event, Subsequent harvests happen every 30 seconds.

BrowserInteraction events

no

no

yes

BrowserInteraction events are harvested immediately after the interaction finishes. The first harvest happens after the load page lifecycle event. There will always be at least one interaction that represents the initial page load. Additional interactions are collected only if the URL changes (representing route change). AjaxRequest events are also harvested at the same time if they occur during an interaction.

Copyright © 2024 New Relic株式会社。

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.