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 in IBM® Cloud Private is deployed by using Microclimate, complete the following steps:
    1. 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');
    2. 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:
    1. 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');
    2. Remove configpack reference.
      • For Kubenetes environment, remove the secret reference and the corresponding mount volume in the application yaml file:
        volumeMounts:
                 - mountPath: /opt/ibm/apm/serverconfig
                   name: serverconfig
        volumes:
             - name: global-environment
               secret:
                 secretName: icam-server-secret
                 optional: true
      • For local on-premise or docker container environment, run the following command:
        rm -f global.environment
        rm -f keyfile.p12
    3. Remove all Node.js data collector resources from the application.
      • 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:
        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"
    4. Apply the changes to make the uninstalling take effect.
      • In local on-premise environment, delete node_modules folder from the home directory of your application, and then run the npm install command to install the application dependencies.
      • In Docker container environment (whether Kubernetes or not), you need to rebuild your docker image.