Monitoring on-premises Node.js applications
You can configure the Node.js data collector to monitor the on-premises Node.js applications running on stand-alone Docker containers, VMs, or physical nodes (xLinux only). The Node.js data collector sends monitoring data to the Unified Agent.
Before you begin
-
Ensure that you install the Unified Agent plug-ins for LWDC and OpenTracing. For more information, see Installing and configuring Unified Agent plug-ins.
-
Ensure that you installed the data collector, for more information, see Installing the Node.js data collector.
Procedure
-
To configure the Node.js data collector for VMs or physical nodes, add the following environment variables:
UA_LWDC_LISTENER_URL=http://<ip or host>:<port> UA_JAEGER_ENDPOINT_ZIPKIN_V2=http://<ip or host>:<port>/api/v2/spans
Where
- <ip or host> is the ip or host address of your Node.js application.
- <port> is the port that you configure in Installing and configuring Unified Agent plug-ins. By default, it is 8848 for
UA_LWDC_LISTENER_URL
and 9411 forUA_JAEGER_ENDPOINT_ZIPKIN_V2
.
-
To configure the Node.js data collector for stand-alone Docker environment, do the following steps:
-
Update the Docker file of your Node.js application by adding the following line to get the write access to the work directory:
RUN chmod 777 nodejs_dir
Where nodejs_dir is the home directory of your Node.js application, for example,
/var/apps/acmeair-nodejs
. -
Add the following environment variables:
UA_LWDC_LISTENER_URL=http://<ip or host>:<port> UA_JAEGER_ENDPOINT_ZIPKIN_V2=http://<ip or host>:<port>/api/v2/spans
Where
- <ip or host> is the ip or host address where you install Unified Agent in on-premises environment.
- <port> is the port that you configure in Installing and configuring Unified Agent plug-ins. By default, it is 8848 for
UA_LWDC_LISTENER_URL
and 9411 forUA_JAEGER_ENDPOINT_ZIPKIN_V2
.
-
Rebuild your docker container with Node.js dc (ibmapm).
docker build -t <application image name>:<image tag>
-