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

The monitoring agent collects data from a running application. You use the Health Center client to analyze and interpret this data. You can use the agent and client together in the following ways:
  • 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.

You can choose the type of connection between the client and the agent, as follows:
  • 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 MQTT, an MQTT broker such as Mosquitto (or Mosca for Node.js) is required to pass messages between the monitoring agent and client. Health Center does not include an MQTT broker; if you do not have one already you can download one from the MQTT.org website.

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.

Procedure

  1. Install the monitoring agent into the runtime environment for the application.
  2. 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.

  3. Start the MQTT broker, if you are using one.
    You can start the broker either before or after you start the agent.
  4. 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.
  5. Connect to the application by using one of the following methods.

Results

The agent runs and starts to collect data.

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.