AppDynamics Application Intelligence Platform

3.8.x Documentation

PDFs

Videos

Release Notes

Skip to end of metadata
Go to start of metadata

Prerequisites for Agent Installation

1. Download the tarball file for the App Agent for Node.js from the AppDynamics beta download zone.
If you do not have access to the beta zone, please request it from your account manager and/or email the Node.js Product Manager: 
omed@appdynamics.com.

2. Be prepared to provide the following information:

  • controller host and controller port: These are the host name or IP address and the port number of the AppDynamics controller that the agent connects to.  On-premise customers establish these settings when they install the controller.
  • AppDynamics application name: This is the name that you assign to the business application you will monitor with the App Agent for Node.js.
  • AppDynamics tier name: This is the name that you assign to the tier you will monitor with the App Agent for Node.js.
  • AppDynamics node name: This is the prefix to the dynamically-generated node name of the server that you will monitor with the App Agent for Node.js. On startup the agent assigns an index based on the startup of the node processes and appends this index to this prefix specified to create the node name that is displayed in the AppDynamics console.

3. You need permission to perform a package installation and to edit the application source code to complete the installation.

Instrumenting Node.js Applications

There are two steps to instrument your Node.js applications:

Installing the Agent

From the root directory of the Node.js application run the command:

npm install <nodejs_tarball_file>

Modifying the Application Code

For every Node.js application that you are instrumenting, insert the following call in the application source code at the first line the main module (such as the server.js file), before any other require statements.

If you are launching a cluster of Node processes to implement your app, add this appdynamics require statement to the master process code and to the code of each of the worker processes.

require("appdynamics").profile({
  controllerHostName: '<controller host name>',
  controllerPort: <controller port number>, // If SSL, be sure to enable the next line
  controllerSslEnabled: true|false, // Optional - use if connecting to controller via SSL
  accountName: '<AppDynamics account name>', // Required for a controller running in multi-tenant mode.
  accountAccessKey: '<AppDynamics account key>', // Required for a controller running in multi-tenant mode.
  applicationName: '<app_name>',
  tierName: '<tier_name>', 
  nodeName: '<node_name>', // Prefix to the full node name.
  debug: true|false // Optional - defaults to false.
 });

Logs

There is an agent log and a proxy log for each application.

Node.js Agent Log

If the agent is running in debug mode, the agent component logs to stdout/stderr. This log contains the transactions that the agent processes and sends to the proxy. This log is available in the same location to which stdout/stderr streams are directed from the monitored application.

If debug mode is not enabled, no agent log is generated.

You set debug mode is in the require statement that instruments your Node.js application. See Modifying the Application Code.

Proxy Log

The proxy logs the transactions that it accepts from the agent and sends to the Controller. The proxy generates logs whether or not the agent is running in debug mode.

When the agent component launches the proxy, it displays in the agent log the directory path to which the proxy is logging.


Installing the Machine Agent on an Node.js Node

If you install the Machine Agent on the machine hosting the instrumented Node.js node and you specify the tier and node name in the machine agent's controller-info.xml file, the App Agent for Node.js will fail to register.

To avoid this problem:

  • Install the App Agent for Node.js before you install the Machine Agent
  • Do not specify the tier and node in the machine agent controller-info.xml, where it is optional. The machine agent will pick up the tier and node from the app agent configuration.
  • No labels