Managing Node.js applications using PM2 Process Manager

Managing Node.js applications using PM2 Process Manager

Configure PM2 Process Manager to manage Node.js applications

Follow the instructions given below to configure PM2 Process Manager to manage Node.js applications:
  1. Configure the processManagerEnabled key in the already created apminsightnode.json file.
  2. Pass the value as true.

    "licenseKey" : "xxxxxxxxxxxxxxxxxxxx",
    "appName" : "appName",
    "apmHost": "localhost",
    "apmPort": "8443"

    "port" : 3000,
    "processManagerEnabled" : "true"

  3. Res​​​​tart your Node.js application.
  1. The above configuration is only available for Node.js agents (v3.1.2 and above).
  2. 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

  1. Each process started by PM2 is treated as a separate instance in Applications Manager.
  1. The instance's name is displayed as hostname: PM2_ID instead of  hostname:port_number.
  2. 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:2apm-linux-test:3 where apm-linux-test is the hostname, and 0, 1, 2 and 3 are the corresponding PM2_IDs.

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

                    New to ADSelfService Plus?

                      • Related Articles

                      • Steps to troubleshoot when no data is available for Node.Js applications.

                        After adding APM Insight Node.Js agent, if you find no data available in the APM Insight Node.Js Application monitor, it could be because of probable reasons like network issues or zero traffic in your application. Kindly read through the below given ...
                      • Method to upgrade Node Js Agent

                        Manual upgrade from user terminal: To upgrade the APM Insight Node.js agent, follow these instructions: Stop the Node.js application. Access the node package manager (NPM). Navigate to the application root directory of the application for which you ...
                      • Self monitor Applications Manager using Real User Monitoring

                        We can monitor the Applications Manager using Real User Monitoring with a Java Script injection and this can be used to measure the Applications Manager's performance continuously. All you need is to install and setup the Real User Monitoring (RUM) ...
                      • Applications Manager default tomcat is down

                        If your Tomcat Monitor is down, it could probably be due to changes in Hostname/IP address of the machine in which Applications Manager is installed. You can verify the same using the steps given below: Navigate to ...
                      • Integrating PagerDuty with Applications Manager using Webhook

                        Using Webhook, you can now integrate PagerDuty with Applications Manager and receive real-time alerts on incidents right into your PagerDuty instance.  Step 1: Configuring PagerDuty Open the required PagerDuty instance to which Applications Manager ...