New Relic Browser features are released gradually to ensure stability and reliability. However, you can opt in to avail yourself of some features before their GA. These are known as experimental features.
Current experimental features
The following experimental features are available in New Relic Browser:
- Browser Agent v1.272.0 - Automatically track native marks and measures as
BrowserPerformance
events. - Browser Agent v1.276.0 - Automatically observe page resource assets as
BrowserPerformance
events.
Important
Experimental features are available only for opting in manually with copy and paste or NPM implementations of the agent. To gain access for APM-injected applications, reach out to your support representative. Experimental features are subject to change and should be used with caution.
Manually opt in to use experimental features
Copy/paste implementation of Browser Performance - Marks, Measures & Resources
- Ensure you are using a version of the New Relic Browser agent compatible with the experimental feature, on a pro or pro+spa equivalent build.
- Find the New Relic browser agent code in your webpage HTML or JS application.
- In the
init
configuration object, add theperformance
feature configuration. Here's an example that enables both marks and measures detection:<script type="text/javascript"> ;window.NREUM||(NREUM={});init={ …, performance: {capture_marks: true, // enable to capture browser performance marks (default false)capture_measures: true // enable to capture browser performance measures (default false)resources: {enabled: true, // enable to capture browser peformance resource timings (default false)asset_types: [], // Asset types to collect -- an empty array will collect all types (default []). See https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/initiatorType for the list of types.first_party_domains: [], // when included, will decorate any resource as a first party resource if matching (default [])ignore_newrelic: true // ignore capturing internal agent scripts and harvest calls (default true)}} }: - Deploy your app.
NPM implementation of Browser Performance - Marks, Measures & Resources
- Ensure you are using a version of the New Relic Browser agent compatible with the experimental feature.
- Find the New Relic browser agent constructor in your application's implementation.
- In the
init
configuration object, add theperformance
feature configuration. Here's an example that enables both marks and measures detection:
import { BrowserAgent } from '@newrelic/browser-agent/loaders/browser-agent'
// Populate using values in copy-paste JavaScript snippet.const options = { init: { // ... other configurations performance: { capture_marks: true, // enable to capture browser performance marks (default false) capture_measures: true // enable to capture browser performance measures (default false) resources: { enabled: true, // enable to capture browser peformance resource timings (default false) asset_types: [], // Asset types to collect -- an empty array will collect all types (default []). See https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/initiatorType for the list of types. first_party_domains: [], // when included, will decorate any resource as a first party resource if matching (default []) ignore_newrelic: true // ignore capturing internal agent scripts and harvest calls (default true) } } }, info: { ... }, loader_config: { ... } }
// The agent loader code executes immediately on instantiation.new BrowserAgent(options)
See the NPM package documentation for more information on how to configure the agent via NPM.
Opt in for APM injected applications
APM-served web applications can opt-in to experimental features by reaching out to your support representative, by filing a help ticket or by emailing browser-agent@newrelic.com
with a subject line starting with [Experimental Features]:
.