Did you know that the Browser agent is capable of collecting two different types of AJAX data? It’s true. Depending on the circumstances, AJAX requests may be recorded as either:
- Event data
- Metric timeslice data
For a more detailed discussion on the distinction between the two types of data, check out New Relic Data Types.
This is confusing, I know, but it’s important to understand how each of these data types are generated in order to know where to find your data. So let’s talk about that!
- Requirements: the Pro or Pro+SPA Browser agent and a Pro subscription
- Where you can find it: in your Browser application’s AJAX view
We record metric data for all requests made using
Notice that I specified that this applies to requests made to
XMLHttpRequest. Requests made using the Fetch API, on the other hand, are handled a little differently and will not generate metric data. For those requests, you’ll need to look to our next data type…
- Requirements: the Pro+SPA Browser agent and a Pro subscription
- Where you can find it: By querying the AjaxRequest event in New Relic One or Insights or in the SPA PageViews breakdown section of the Browser UI
In order to understand this data, you first need to understand that a
BrowserInteraction event includes not just the initial triggering user interaction, but also the resulting AJAX requests. (See our support document for more information on SPA data collection.)
Any requests that happen within the course of a
BrowserInteraction, whether that request is made using Fetch or
XMLHttpRequest, will be recorded as an
AjaxRequest event along with a variety of default or custom attributes. They will be reported along with the associated
BrowserInteraction data to http://bam.nr-data.net/events.
If the request was not made during a
BrowserInteraction - for example, if it was made after a route change was completed - it will not generate an
If you ever want to see how many
AjaxRequest events were reported along with any given
BrowserInteraction, you can examine the
BrowserInteraction event in a query and look for the
ajaxCount attribute - this will tell you how many requests were included in the timing of that interaction.
To summarize: is the data really missing, or are you just looking for it in the wrong place?
If the request is made using Fetch:
Assuming you meet the requirements noted above for Ajax request event data, you should be looking for the data in either an
AjaxRequest event query or in the SPA PageViews breakdown.
If the request is made using
You should be able to find it in the AJAX view of the Browser UI. If it was made during a
BrowserInteraction however, it should also be reported as event data and you can locate it as noted above.