Monitoring a running application
Use the Health Center to connect to, and monitor, an application. For example, you can monitor Java™ or Node.js applications.
About this task
- Connect the client to the agent while the agent is running, to view the data as it is being collected.
- Configure the agent to save the data to a file, then use the client to view the data after collection finishes. This option is known as headless mode. This option applies to Java applications only. This option is not available for applications that are running in IBM® Bluemix®.
You can also use the Health Center API to retrieve data from the agent, instead of using the Health Center client.
- If you want to monitor a Java application, you can choose to connect by using either the JMX API or the MQTT telemetry protocol.
- For other application types, you must use MQTT.
- You can also monitor Bluemix applications that are running in the Liberty for Java or SDK for Node.js runtime environments.
If you choose Bluemix, the monitoring agent is already provided by Bluemix and cannot be configured. You can skip the following steps and instead go straight to Connecting an application to the Health Center client.
- Install the monitoring agent into the runtime environment for the application.
Configure the monitoring agent.
You configure the agent by setting properties, for example the port number to use when the agent attaches to the application, or whether to use headless mode. You can set these properties before you start the agent. For Java applications, you can also set some properties at the same time as you start the agent.
If you are using an MQTT broker, you must set the com.ibm.diagnostics.healthcenter.mqtt property to on. You must also ensure that the MQTT host and port properties match the host name and port for your broker. Refer to your broker documentation for information about these values. Health Center uses these settings to find and use your MQTT broker.
For more information about Health Center properties, see Configuring the monitoring agent.
Start the MQTT broker, if you are using one.
You can start the broker either before or after you start the agent.
Start the monitoring agent.
You usually start the agent at the same time as you start the application. For Java applications only, you can also start the agent when the Java application is already running. For more information, see Starting the monitoring agent.
Connect to the application by using one of the following methods.
- Use the Health Center client. For more information, see Connecting an application to the Health Center client
- Use the Health Center API. For more information, see Using the Health Center API.
Note: You cannot use the API to connect to a Bluemix application.
If you are using an MQTT broker and the broker stops, the agent will reconnect when you restart the broker, though some data will be lost
What to do next
To learn more about the data that the Health Center client displays, see Data available on connection to a running application.