Problem
You are not seeing AJAX data for your browser app.
Solution
If your application is instrumented with browser monitoring and is correctly collecting data for other Pro features, follow these steps:
Use your browser's dev console to verify page has been correctly instrumented. Enter XMLHttpRequest
and/or fetch
into the console.
If instrumentation has succeeded, the console should return something like:
// XMLHttpRequest ƒ (e){const t=new o(e),n=r.context...
// fetch ƒ (){var t=3,n=(0,r().getTrace...
If instrumentation failed, you will see something like:
// XMLHttpRequestƒ XMLHttpRequest() { [native code] }
// fetch ƒ fetch() { [native code] }
If you see this type of failure or you see a different response, AJAX instrumentation may be disabled or you may be using another script or library that is conflicting with New Relic instrumentation.
AJAX instrumentation is not included in the lite agent. Open your browser console dev tool and check the newrelic.initializedAgents
object. This object contains an entry for every agent running on the page. There is typically only one agent on a page. Inspect the initialized agent object for a runtime
object. This object contains information about the running agent like loaderType
. If loaderType
is lite
, AJAX instrumentation is not included in the agent being used.
If the loaderType
is not lite
, you can also check the initialized agent for config
and features
objects. The config
object will contain runtime configuration of the agent, including an ajax
object with an enabled
boolean. The features
object should contain an entry for each feature initialized by the agent, including an ajax
entry. Verify this ajax object contains a boolean enabled
of true
and featAggregate
entry. If any of these items are not true, the AJAX instrumentation may not have initialized due to a configuration change in New Relic on the browser entity or possibly a manual change to the NREUM.init
object that was copy/pasted into the HTML.
The agent can be configured to ignore certain domains and paths when creating AjaxRequest Events.
Use your browser's dev console to check the current AJAX deny list rules by running newrelic.init
. Look for a property ajax
containing an array called deny_list
.
If you see entries in the deny list that are unfamiliar or causing AJAX calls to be filtered, review the Filter AjaxRequest Events documentation for further guidance.
If the object is properly instrumented, try triggering an AJAX call in your application while monitoring network traffic in the browser's developer tools. Wait up to one minute, and look for a call to bam.nr-data.net/jserrors
with an xhr
parameter. If the call fails, check for network issues.
If you don't see this call, if it fails with an error not related to network access, or if it succeeds but you still aren't seeing data, continue through the troubleshooting documentation.
If your requests use JSONP, see requirements and notes on functionality below:
If your requests use JSONP, these requests will not appear on the AJAX UI page. However, you can view them as assets within session traces. If using SPA monitoring, you can view them on the Breakdown tab of the Page views page.
Requirements for JSONP to be recognized:
- Each JSONP request must use a unique callback function. Most popular libraries (like jQuery) generate a unique callback function dynamically for each request.
- The query string containing the callback function name must be named
"callback"
or"cb"
in order to be recognized by New Relic. This is the default behavior in most popular libraries.
If any of these troubleshooting steps fails or you are still having issues with missing AJAX data, get support at support.newrelic.com.