title: Nodejs- capturing business events - http,http outbound
body: <p>I am trying to capture business events - APIs (http-GET and http outbound- POST,PUT) and I am using appmetrics package but it capures events of http request of page</p>
  
  <p>But it is not capturing all API calls made and posting data </p>
  
  <pre><code>const appmetrics = require('appmetrics');
  const monitoring = appmetrics.monitor();
  const request    = require('request');
  const http = require("http");
  const metrics = require('./index.js');
  
  module.exports = http.createServer(function (request, response) {
  
     response.writeHead(200, {'Content-Type': 'text/plain'});
  
     response.end('Hello World\n');
  }).listen(8083);
  
  request
    .get('https://jsonplaceholder.typicode.com/users')
    .on('response', function(response) {
      console.log(response.statusCode) // 200
      console.log(response.headers['content-type']);
    })
  
  console.log('Server running at http://127.0.0.1:3000/');
  
  appmetrics.enable('http');
  appmetrics.enable('request');
  monitoring.on('request', function (request) {
          console.log('request', request);
  });
  monitoring.on('http', function (http) {
          console.log('http', http);
  });
  </code></pre>
  
  <p>Above appmetrics captures only page requests but not all api GET calls from this script</p>