Uninstalling the Node.js data collector
To uninstall the Node.js data collector, roll back the changes that you have made to your application and then update the application deployment.
Procedure
-
If the Node.js application is deployed by using Microclimate, complete the following steps:
-
Complete one of the following steps:
-
To uninstall the Node.js data collector that was set up without internet access, edit the main file of your Node.js application to remove the following line:
require('./ibmapm');
-
To uninstall the Node.js data collector that was set up with internet access, edit the main file of your Node.js application to remove the following line:
require('appmetrics');
-
-
Push your project to a new repository that the Microclimate pipeline is monitoring.
-
-
If the Node.js application is not deployed by using Microclimate, complete the following steps to uninstall Node.js data collector from the Kubernetes environment and on-premises environment.
-
To uninstall Node.js data collector from the Kubernetes environment:
-
Do one of the following steps:
-
To uninstall the Node.js data collector that was set up without internet access, edit the main file of your Node.js application to remove the following line:
require('./ibmapm');
-
To uninstall the Node.js data collector that was set up with internet access, edit the main file of your Node.js application to remove the following line:
require('appmetrics');
-
- In the namespace where the
Node.js
application is deployed, remove the current Docker image by running the docker rmi command. The following example removes the Docker image by using the image tag:docker rmi -f mycluster.icp:8500/admin/trader:node.js
-
In the same namespace, from the same folder as the updated Docker file, build and tag the Docker image again with the updated Docker file by running the following command:
docker build -t docker_image_name:image_tag .
where docker_image_name:image_tag is the tagged Docker image, which must contain the IBM Cloud Pak for Multicloud Management registry.
Example:
docker build -t mycluster.mcm:8500/admin/trader:node.js .
where
mycluster.mcm:8500
is the IBM Cloud Pak for Multicloud Management registry. -
Remove all Node.js data collector resources from the application.
-
To uninstall the Node.js data collector that was set up without internet access, go to the root folder of Node.js application, and then run the following command to delete
ibmapm
directory:rm -rf ibmapm
-
To uninstall the Node.js data collector that was set up with internet access, edit the main file of your Node.js application to remove the following dependencies line in
package.json
of your application:"appmetrics": "^5.0.0"
-
-
Rebuild your docker image to make the uninstalling take effect.
-
-
To uninstall data collection for on-premises Node.js applications, complete the following steps:
-
Do one of the following steps:
-
To uninstall the Node.js data collector that was set up without internet access, edit the main file of your Node.js application to remove the following line:
require('./ibmapm');
-
To uninstall the Node.js data collector that was set up with internet access, edit the main file of your Node.js application to remove the following line:
require('appmetrics');
-
-
Remove the following dependency from "" from the dependencies section in the
package.json
file of your Node.js application.appmetrics":"^4.0.0"
-
Delete the
node_modules
folder from the home directory of your application. -
Remove the 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
.
-
Run the npm install command to install the application dependencies.
-
-