Managing Node.js applications using PM2 Process Manager
Follow the instructions given below to configure PM2 Process Manager to manage Node.js applications:
- Configure the processManagerEnabled key in the already created apminsightnode.json file.
- Pass the value as true.
Example:
{
"licenseKey" : "xxxxxxxxxxxxxxxxxxxx",
"appName" : "appName",
"apmHost": "localhost",
"apmPort": "8443"
"port" : 3000,
"processManagerEnabled" : "true"
}
- Restart your Node.js application.

- The above configuration is only available for Node.js agents (v3.1.2 and above).
- The PM2 Process Manager (version 2.0) is compatible with the APM Insight Node.js agent.
How Applications Manager handles the processes started by PM2
- Each process started by PM2 is treated as a separate instance in Applications Manager.
- The instance's name is displayed as hostname: PM2_ID instead of hostname:port_number.
- For example: In the below screenshot, the four processes that are started using PM2 are displayed as apm-linux-test:0, apm-linux-test:1, and apm-linux-test:2, apm-linux-test:3 where apm-linux-test is the hostname, and 0, 1, 2 and 3 are the corresponding PM2_IDs.

- The port number is the same for all instances. Hence, PM2_ID is used to differentiate them.
- Each instance started by PM2 is treated as a separate APM instance and requires its own advanced monitor license.
New to ADSelfService Plus?