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:

    • Bluebird

    • shim.js

    • Zone.js

      If you use the zone.js library, you can still enable monitoring for the Fetch API by adding isZonePromise = true and config.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>
      JS
      <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>
      JS



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>
JS
<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>
JS