Installing APM Insight Node JS Agent


To install APM Insight Node.js agent in Applications Manager, follow the below given instructions:

  1. Open your Node.js application.
  2. Access the node packet manager (NPM).
  3. Use the command npm i apminsight --save to install an APM Insight Node.js agent from NPM. This will create an APM Insight directory under node_modules.
  4. Include the following code in the first line of your Node.js application start file:
    require('apminsight')({
    licenseKey : '[LICENSE-KEY]',
    appName : '[APPLICATION-NAME]',
    port : [APPLICATION-PORT],
    apmHost: '[HOST-NAME]',
    apmPort: [HOST-PORT]
    })

    Example:

    require('apminsight')({
    licenseKey : 'APMI_ee42094f83dd841d16b9c56796c22b63bef00ac6918f547280947d1f6c2be1ea',
    appName : 'Insight_NodeJS',
    port : 8081,
    apmHost: 'app-w8-test',
    apmPort: 8415
    })
  5. If you use proxy connections, enter this code instead:
    require('apminsight')({
    licenseKey : '[LICENSE-KEY]',
    appName : '[APPLICATION-NAME]',
    port : [APPLICATION-PORT],
    apmHost: '[HOST-NAME]',
    apmPort: [HOST-PORT]
    proxyServerHost : '[PROXY-SERVER]',
    proxyServerPort : [PROXY-PORT],
    proxyAuthUser : '[PROXY-USERNAME]',
    proxyAuthPassword : '[PROXY-PASSWORD]'
    })
  6. Note: You can find your license key in the APM Insight tab after logging into Applications Manager.

  7. Save the file and restart your application.