How does the Node.js Profiler Communicate with the eG Agent?

The eG agent should be deployed on the same Node.js application that hosts the Node.js Profiler. The Node.js Profiler communicates with the eG agent via port number 23700 by default. You can change the default port by following the steps below:

  • Edit the eg_tests.ini file (in the <EG_MANAGER_INSTALL_DIR>\manager\config directory on a Windows manager, or the /opt/egurkha/manager/config directory on a Unix manager).
  • Configure the new port number against the NodeJSAgentServerSocketPortNo parameter in the [AGENT_SOCKET_SETTINGS] section of the file. Note that you cannot set any random port number against the NodeJSAgentServerSocketPortNo parameter. You have to pick a port number from the list of port numbers present against the NodeJSAgentServerSocketPortOrder parameter, and configure the NodeJSAgentServerSocketPortNo with that port number only. If you configure a port number that is not available against NodeJSAgentServerSocketPortOrder, then the eG Node.js Profiler will not be able to communicate with the eG agent.
  • Finally, save the file.

Typically, once the eG agent is configured with the details of the Node.js application to be monitored, the eG Node.js BTM contacts the eG agent and downloads these details from it.

Figure 1 : Communication between the Node.js Profiler and the eG Agent

Then, when a transaction request for the Node.js application comes in, the eG Node.js BTM injects a code in the application code to trace the path of that request. In the process, the eG Node.js BTM also collects response time metrics related to that transaction. Every 10 seconds, the eG Node.js BTM sends these metrics to the eG agent. The eG agent stores these metrics in memory, until the next time it runs the Node.js Business Transactions test. When the test is run, the agent pulls the metrics stored in memory and sends it to the eG manager.