By default, the JavaScript Agent reports Ajax requests made with XMLHttpRequest object (XHR) and the Fetch API.
You should only consider disabling monitoring support for the Fetch API for these use cases:
- You just started using the JavaScript Agent 4.5.6 and start to see JavaScript errors caused by asynchronous Ajax requests.
Your browser app uses one of the libraries which modifies Javascript Promise:
If you use the zone.js library, you can still enable monitoring for the Fetch API by adding
isZonePromise = true
andconfig.fetch = true
to your JavaScript snippet:<script type='text/javascript' charset='UTF-8'> (function(config){ config.fetch = true; // This is the default setting. config.isZonePromise = true; config.spa = { "spa2": true }; })(window['adrum-config'] || (window['adrum-config'] = {})); </script> <script src='//cdn.appdynamics.com/adrum/adrum-latest.js' type='text/javascript' charset='UTF-8'></script>
<script type='text/javascript' charset='UTF-8'> (function(config){ config.fetch = true; config.isZonePromise = true; })(window['adrum-config'] || (window['adrum-config'] = {})); </script> <script src='//cdn.appdynamics.com/adrum/adrum-latest.js' type='text/javascript' charset='UTF-8'></script>
Disable Monitoring of Fetch API Calls
To disable monitoring for the Fetch API, add config.fetch = false
to your JavaScript snippet:
<script type='text/javascript' charset='UTF-8'> (function(config){ config.fetch = false; config.spa = { "spa2": true }; })(window['adrum-config'] || (window['adrum-config'] = {})); </script> <script src='//cdn.appdynamics.com/adrum/adrum-latest.js' type='text/javascript' charset='UTF-8'></script>
<script type='text/javascript' charset='UTF-8'> (function(config){ config.fetch = false; })(window['adrum-config'] || (window['adrum-config'] = {})); </script> <script src='//cdn.appdynamics.com/adrum/adrum-latest.js' type='text/javascript' charset='UTF-8'></script>