Prerequisites
To monitor Node.js Applications, You need to configure both Node.js and Single agent. Ensure that both are running on the same machine:
- Single Agent
- Node.js Agent
Monitoring
1: Install Applicare SingleAgent on the machine running Tomcat by following these steps
installing Applicare SingleAgent
2 a. Run deploynodejsagent.bat with elevated (Administrator) privileges from the directory agentscripts inside Applicare SingleAgent installed folder. Once executing started , the message "Enter any open port for Applicare Agent" will appear in the command window and enter any open port in the machine.
b. Enter the Node.js home path where your nodejs application is running.
c. Once the agent is successfully installed, You will see a message similar to the one shown below.
3. Zero code instrumentation : Execute your nodejs application with "-r ./agent-injector.js" to inject Applicare SingleAgent in your application. For example if you start your application with a command "node wss_server.js", then you should invoke it as "node -r ./agent-injector.js wss_server.js"
(OR)
Manual instrumentation : Navigate to the Node.js application home directory and insert the following code at the beginning of the main file (usually called server.js or app.js). Then, restart the Node.js server.
var applicareConfig = require('./agent.config.js');
var applicare = require('applicare-agent')(applicareConfig);
4. Go to the SingleAgent home directory and execute the command based on the OS.
5.Open a command window in administrator mode, go to the Agent_home/agentscripts directory and execute the file below.
createNodejsAgentTask.bat
Comments
0 comments
Please sign in to leave a comment.