If you have many XHR calls (using XMLHttpRequest or the Fetch API) from your page that you do not need to monitor, you can use XHR filters so that the Agent only monitors a regex-defined list of specified calls.
You can use the XHR filters below to include or exclude XHR calls. The filters can be in the form of an XHR filter object or an array of XHR filter objects.
Filter Object Structure
The XHR filter object has two properties:
urls property is an array of objects containing a
pattern property that specifies a regular expression for matching URLs. The
method property is a string that specifies an HTTP method. You can use one or both of the properties. If you only use the
urls array, the matched URLs will be either included or excluded for all HTTP methods. If you only specify
method, all calls using the specified HTTP method will be either included or excluded.
The following is the general structure for the filter object:
XHR Filter Example
To use XHR filters, you must assign XHR filters to
xhr.exclude before you inject the
adrum.js script. It's important to note that the exclude patterns override the include patterns, so those URLs that are matched by both the include and exclude patterns will ultimately be excluded.
For example, in the code snippet below, the include pattern would match all HTTP requests to
http://somedomain/app_status/user-profile.jsp, but the exclude pattern would exclude POST calls to that URL.