Configuring the Liberty data collector in IBM Cloud environment (Liberty V18.* and older versions)
To monitor a Liberty profile running in the IBM® Cloud environment, you must download the data collector package from IBM Marketplace, deploy the data collector to your local application files, and then push the updates to IBM Cloud.
Before you begin
It is assumed that the Liberty application is pushed to the IBM Cloud environment by using the Cloud Foundry commands. The manifest.yml file and the Liberty server home directory (which contains the server.xml file) already exist.
- Issue the following command to run the Liberty application
locally:
mvn install liberty:run-server
In the directory that contains the Liberty WAR file, a sub-directory, /liberty/wlp/usr/servers/defaultServer, is created. This directory can serve as the Liberty server home directory in the following procedure.
- From the root directory that contains the Liberty WAR file, copy the entire application_name-SNAPSHOT folder to the /liberty/wlp/usr/servers/defaultServer directory.
- In the /liberty/wlp/usr/servers/defaultServer directory, edit the bootstrap.properties file to modify the appLocation path. The appLocation path must be set to the relative path to the application directory in IBM Cloud.
- Remove the logs and workarea folders. They do not need to be pushed to IBM Cloud.
- Modify the path value in the manifest.yml file to
point to the defaultServer directory.
For example,
path: target/liberty/wlp/usr/servers/defaultServer
.
Procedure
Complete the following steps to configure the Liberty data collector:
Results
What to do next
- To view the monitoring data for your IBM Cloud
application, start the Cloud APM console. For
instructions, see Starting the
Cloud APM console. For information about using the Applications editor, see Managing
applications.Remember: When you want to add the Liberty data collector instance on the Application Dashboard, select Liberty Runtime instead of WebSphere Application Server from the component list.
- For the Heap Dump dashboard and/or Memory Analysis dashboard to contain data, you also need to enable the data collector for heap snapshot collector and/or memory allocation collection, which can be done in the data collector .properties files. See Customizing data collector with properties files.
- If the key file or the Cloud APM server changes, reconnect the data collector to the Cloud APM server. For instructions, see Reconnecting the data collector to the Cloud APM server.