Configuring Node.js Probe Agent as an Application Dependency

Document ID : KB000076571
Last Modified Date : 05/04/2018
Show Technical Document Details
Introduction:
  This supplements what is currently in the documentation.
 
Background:
  ​We are trying to install a Node.js agent but it seems that we missed a step.
Because after the installation, configuration, etc., when we try to start the application, it fails. We see no logs as well.

According with the documentation, we have downloaded and installed the infrastructure agent, and the Node.js probe agent.
Environment:
  APM Node.js Probe Agent for SaaS
Instructions:
https://docops.ca.com/ca-apm/10-7/en/implementing-agents/node-js-agent/install-the-node-js-agent/install-and-run-the-node-js-probe-agent

Selecting "Install and Manually Configure the Node.js Probe Agent as an Application Dependency (Code Change)" as our approach:

Then adding the following first line to your application main entry point script (for example, server or server.js)
var probe = require('ca-apm-probe').start(<Infrastructure-agent-host>, <Infrastructure-agent-port>, <probe-name>);

Some suggestions:
- Make sure the agent can find the hostname. 
- Try using the IP address for the infrastructure agent instead
- Look in the application log for errors.
- Place each of the three above arguments in quotes.

Make sure that the above port argument is really the argument of the infrastructure agent that is also on the config.json file that is talked about in https://docops.ca.com/ca-apm/10-7/en/implementing-agents/node-js-agent/configure-apm-for-node-js  and of course is open by the server for two-way communications.