Monitoring Microclimate-based Liberty applications in Kubernetes

By default, applications that are created by using Microclimate include the Microclimate > App Monitor in-built monitoring dashboards. If these applications are deployed in IBM Cloud Private, in production, you should upgrade to the Monitoring server to get polyglot application monitoring, and alerting and analytics across your hybrid cloud applications. If you have access to the Monitoring server, you can configure the Microclimate-based Liberty applications easily to be monitored by Monitoring.

Before you begin

Ensure that you have installed and configured the following:

About this task

You must delete the old Cloud APM data collector configuration from the Dockerfile that is generated in Microclimate before you configure the Microclimate-based Liberty applications to be monitored by the server.


Deleting the old Cloud APM data collector configuration

  1. In your application directory, remove the following lines from the Dockerfile:

    RUN installUtility install --acceptLicense defaultServer && installUtility install --acceptLicense
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/opt/ibm/wlp/usr/extension/liberty_dc/toolkit/lib/lx8266 \
         JVM_ARGS="$JVM_ARGS -agentlib:am_ibm_16=defaultServer -
    Xbootclasspath/p:/opt/ibm/wlp/usr/extension/liberty_dc/toolkit/lib/bcm-bootstrap.jar -
    Xverbosegclog:/logs/gc.log,1,10000 -verbosegc - -

    Configuring the Liberty data collector

  2. Enable your application with the Monitoring data collector.

    • If you use Open Liberty, add the following lines to your Dockerfile:

      COPY path_to_esa_file /opt/
      RUN mkdir -p /opt/ol/wlp/usr/extension/lib/features/
      RUN cd /tmp && unzip /opt/javametrics.liberty.icam-1.2.1.esa && mv /tmp/wlp/liberty_dc /opt/ol/wlp/usr/extension/ && mv /tmp/OSGI-INF/SUBSYSTEM.MF /opt/ol/wlp/usr/extension/lib/features/
      COPY path_to_silent_file /opt/ol/wlp/usr/extension/liberty_dc/bin/
      RUN /opt/ol/wlp/usr/extension/liberty_dc/bin/ -silent
    • If you use WebSphere Liberty, add the following lines to the Dockerfile:

      RUN chmod 777 liberty_server_dir
      RUN /opt/ibm/wlp/bin/installUtility install ibmAppMetricsForJava-1.2.1 --acceptLicense
      RUN /opt/ibm/wlp/usr/extension/liberty_dc/bin/ -silent

      This enables your application container to include the Liberty data collector. If the Monitoring configuration isn’t provided, the data collector remains in a disabled state.

  3. To enable the Liberty data collector to communicate with the Monitoring server at a later stage, follow step 1 and step 5 in Monitoring Liberty applications in Kubernetes environment.