Overview
You can use the monitoring service of SAP HANA Cloud Platform to receive states and metrics of HCP Java applications as well as of the applications’ processes. These Java applications can be in different HCP accounts or even on different data centers (locations). For more information about the currently supported data centers and their hosts, see Landscape Hosts.
To achieve this, you only need to develop a custom dashboard application that will display the metrics you need in the way you prefer. You can also use this application in your corporate network or in the HCP network. Furthermore, you can choose your own UI technology for this dashboard application. For example, you can use SAPUI5 or SAP Fiori.
Process Flow
The communication between your dashboard application and the monitoring service works as follows:
Image may be NSFW.
Clik here to view.
- A user accesses a dashboard application in the web browser.
- The dashboard application requests metrics of aJava application from the monitoring service with a REST API call.
For more information about the REST call, see Monitoring API.
- The monitoring service retrieves the metrics of the Java application and creates a JSON response.
- The monitoring service sends back the JSON response with a status code 200 OK.
The response contains the state and metrics of the requested application.
- The dashboard application parses the JSON response and places the metrics in a list.
- The dashboard application requests the metrics of other Java applications by repeating steps 1 to 5.
- The dashboard application’s UI uses the list with metrics to display those metrics in the browser.
Example
Donna Moore, as an administrator of Company A, would like to use a central application to monitor the company’s Java applications and their processes. Company A is located in Europe, but it has subsidiaries in the United States (us1) and Australia (ap1). Furthermore, the company uses the following Java applications:
- app1 - an application created for a1 account and used in the European data center.
- app2 - an application created for a2 account and used in the European data center.
- app3 - an application created for b1 account and used in the United States (US East) data center.
- app4 - an application created for b1 account and used in the United States (US East) data center.
- app5– an application created for c1 account and used in the Asia-Pacific (Australia) data center.
For that purpose, Donna asks her developers to implement a dashboard application that will retrieve and display the state of her Java applications and the metrics of each application’s processes every minute. The update period is a minute because the metrics of a Java application are refreshed each minute. Furthermore, she requests that the dashboard application displays the name, state, value, and date of each metric.
As a result, the company developers create an SAP Fiori dashboard application that makes the following REST API requests for each of the five Java applications:
- For app1: https://api.hana.ondemand.com/monitoring/v1/accounts/a1/apps/app1/metrics
- For app2: https://api.hana.ondemand.com/monitoring/v1/accounts/a2/apps/app2/metrics
- For app3: https://api.us1.hana.ondemand.com/monitoring/v1/accounts/b1/apps/app3/metrics
- For app4: https://api.us1.hana.ondemand.com/monitoring/v1/accounts/b1/apps/app4/metrics
- For app5: https://api.ap1.hana.ondemand.com/monitoring/v1/accounts/c1/apps/app5/metrics
For each Java application, the monitoring service returns a JSON response containing the following parameters:
- account - the name of the account;
- application - the name of the application;
- state - the state of the application, metric, or process;
- processes - a list of processes as each process contains the parameters process (the process ID), state (the state of the process), and metrics (the list of metrics for that process).
- metrics - a list of the metrics as each metric contains the following parameters:
- name - the name of the metric, for example, Availability Check, CPU Load, etc.
- state - OK, WARNING (not used for a status metric), or CRITICAL;
- value - the metric’s value;
- unit - the unit for the value;
- timestamp - time in milliseconds from January 1, 1970 to this call;
- warningThreshold - the warning threshold or the lower threshold;
- errorThreshold - the critical threshold or the upper threshold;
- min - minimum value
- max - maximum value
- metricType - the following types are supported:
- status - the status metric returns directly the OK or CRITICAL state of the metric.
- performance - the performance metrics are used to compare the returned value with the predefined warning and critical thresholds. Values less than the warning threshold result in an OK state, values between the warning and the critical thresholds result in a WARNING state, and values greater than the critical threshold are considered as CRITICAL.
- rate - the rate metrics are similar to the performance metrics, but the returned value is calculated as a percent from the minimum and maximum values and compared with the warning and critical thresholds.
Hint: Enter the address https://api.<landscapeHost>/monitoring/v1/accounts/<accountName>/apps/<appName>/metrics in your browser to check what metrics are returned for each of your running Java applications.
The Company A’s dashboard application parses each JSON response, and retrieves the name and state of each application as well as the name, state, value, unit, and timestamp of the metrics for each process.
When Donna opens the dashboard application in the browser, it initially shows the states of the Java applications.
Image may be NSFW.
Clik here to view.
To see the metrics of a process, she selects the process in the table.
Image may be NSFW.
Clik here to view.
This blog describes a scenario in which you retrieve metrics of Java applications running on SAP HANA Cloud Platform. However, your scenario might also include components from other platforms such as on-premise systems, other cloud systems, or public services. In that case, you can extend the dashboard application or your company tool to show the necessary metrics for such a scenario.