Node JS Agent Configuration
To monitor Node JS Applications we need to configure Node JS and Single agents. These two agents should run in the same machine.
- Single Agent
- Node JS Agent
Communication is Bidirectional
Applicare controller <---> SingleAgent
Applicare controller <--> Node JS Agent
SingleAagent <--> Node JS Agent
Adding Node JS Agent:
Step 1: Go to the single agent's installation folder (<StandaloneAgentHomeDir>/agent/nodejs/) and copy the applicare-agent folder and its contents.

Step 2: Paste this folder and its contents inside the node_modules folder of your node js application. (Employee directory contains the node js application)

Step 3: Go into the applicare-agent folder (<live-server>/node_modules/applicare-agent) and execute the below command in the terminal:
npm install

After the successful completion of the install process "node_modules" folder will be created inside the "applicare_agent" folder.

Step 4: Move the agent.config.js and agent-injector.js file from the "applicare_agent" folder to the root directory of the application.


Step 6: Update the Node.js applicare agent configuration, especially the Node.js agent server name, Applicare Server IP, and port in the agent.config.js file.
Step 7: If your Applicare server uses SSL, change the applicareServerSSL value into true and serverPort value into 8443 in the agent.config.js file.
Step 8: If the Applicare server is using self signed certificate for SSL feature, we need change the applicare_SSL_self_signed_cert value into true, otherwise false.

Step 9: Start Node JS Server with the blow command.
Syntax:
node --require ./agent-injector.js your-app.js
Example:
My app is server.js thn the above command will be
node --require ./agent-injector.js server.js
Note:
1. For every Node JS agent, the servername should be unique.
2. We should set the same Server-name in both the Node JS (agent_config.js) file and Singleagent (catalina.bat/sh) file.
Assigning Standalone agent server name
Scenario 1:
One Node JS agent and one SingleAgent:
Node JS servername : NodeServer,
SingleAgent servername : NodeServer,

Scenario 2:
Multiple Node JS agent and Standalone Agent:
Second Node JS servername : NodeD,
Second SingleAgent servername : NodeD,


Step 9: Restart the " Node JS" server.
Adding the Node JS Agent in Applicare server
Step 10: The Node JS agent will automatically add to Applicare controller.
Step 11:Login into Controller and see the Node JS agent is added in the Overview screen.

Step 12 : Edit the Agent and add the application name for the agent.
Step 13 : Add the App name to the Agent and save.

Step 14: Finally Start the Standalone Agent.
Node JS Monitoring in Applicare
Dashboard

Server Analyzer
App Server

OS

CPU Cores

Processes

Disk

Network Connections

HTTP

Business Transactions
Top Business Transactions

Adding Key Business Transactions


The success Message

We can get the individual transaction details for the URL's added as KBT in a minute or so.
Key Business Transaction Load

Key Business Transactions Load Distribution

Viewing the individual transaction details
Transactions

By clicking the zoom icon it will display the url and query parameters and invocation time and count for that url.


Enabling the "Http Error" and "Webservices" aspects.
Go to Menu --> Configure Dynamic Instrumentation



Select the "Http Error Code Profiling" and "External Webservices" from the left and add it to the right hand side.

The selected aspects will be moved to the right hand side. Now click the tick button to save the changes.

Click "OK" in the popup.

The aspects are added successfully. Now click the "Home" button at the top to go to home screen.

Go to Server Analyzer
Errors

External Webservices

Enabling the "SQL" aspect.
Go to Menu --> Configure Dynamic Instrumentation




Select "OK" in the Popup.


Go to Server Analyzer
SQL

Enabling the "User Experience" aspect.
Go to Menu --> Configure Dynamic Instrumentation




Click "OK" in the popup.


Go to User Experience
Overview

Transactions summary

Real Time Transactions
Please select the row

Browsers

Server
OS

Analytics

Configuration for adding more than one Node JS agent from the same machine to a single Standalone agent.
1. Please make sure that, one Node JS agent is already added to applicare and stand alone agent is running for that agent. If not please install the node js agent and standalone agent using the above steps and start the agents.
2. To add one more node js agent to applicare please follow step 1 to 13. After the successful completion of all the 13 steps we would have successfully added one more node js agent to applicare.
3. Now Stop the 'Standalone agent".
4. Go to the path <ApplicareStandaloneHomeDir>/server/bin/catalina.bat/sh
5. Edit Catalina.bat/sh and go to JAVA_OPTS.
6. At the end of the JAVA_OPTS value leave one space and add the
jvm argument -DcommonSAForNodeJS=true
For Windows edit Catalina.bat file and save

For Linux edit, Catalina.sh file and save

7. Start the Standalone agent.
Note:
1. If we would like to add few more Node JS agent from the same machine, follow step 1 to 13 to add the agents.
2. After adding all the agents restart the standalone agent only once.
3. For adding multiple node js agent from the same machine then running one standalone agent on that machine is enough.
4. If we are going to add node js agent from different machines then we need to make sure separate standalone agents are running for their respective machines.
5. In all the above cases only node js agent should be added to applicare and standalone agent will be running in background for that agent.
6. For MongoDB - SQL Profiling will be supported from 2.2.36 and above versions.
7.3.5 version onwards:
- Go to the Node.js agent's installation folder where you have installed Applicare itself (<Applicare>/agent/nodejs/) and copy the applicare-agent folder and its contents.
- Paste this folder and its contents in the node_modules folder of your application.
- Go into the applicare-agent node-module folder (<live-server>/node_modules/applicare-agent) and execute the below command in the terminal:
npm install
- Move the agent.config.js file in this folder to the root directory of the application.
-
Paste the below code in the first line of main file (usually called server.js or app.js) of the application
var applicareConfig = require('./agent.config.js');
var applicare = require('applicare-agent')(applicareConfig); - Update the Node.js applicare agent configuration, especially the Node.js agent server name, Applicare Server IP, and port.
- If your Applicare server uses SSL, change the applicareServerSSL value into true and serverPort value into 8443 in the agent.config.js file.
- If the Applicare server is using self signed certificate for SSL feature, we need change the applicare_SSL_self_signed_cert value into true, otherwise false.
- Restart the Node.js server.
Up to 7.3.4 version:
- Go to the Node.js agent's installation folder where you have installed Applicare itself (<Applicare>/agent/nodejs/) and copy the applicare-agent folder and its contents.
- Paste this folder and its contents in the node-modules folder of your application.
- Go into the live server's root directory and execute the below command in the terminal:
npm install
- Go into the applicare-agent node-module folder (<live-server>/node_modules/applicare-agent), and move the agent.config.js file to the root directory of the application.
- Paste the below code in the first line of main file (usually called index.js or app.js) of the application:
var applicare = require('applicare-agent');
- Restart the Node.js server.
Please sign in to leave a comment.
Comments
0 comments