Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Nikola_Simeonov
Advisor
Advisor


Note: This blog post is outdated. Please find the up-to-date version at Use the Monitoring Service for Critical Notifications and Self-Healing of Java Applications in the N....

Overview


As an operator, you can use the monitoring service to receive notifications and to fix Java application issues when critical metrics are detected. That way a custom application can notify you through different channels when a critical metric persists for some time. Consequently, the application can take the necessary actions to prevent the SAP Cloud Platform Java application from undesired outcomes such as crashes and loss of data.

Currently, you can use the SAP Cloud Platform tools to configure email notifications only for availability checks and custom JMX checks of running Java applications. That means SAP Cloud Platform can send you an email alert for any critical custom metrics and availability checks. For more information, see Configuring Availability Checks from the Console Client and JMX Checks.



Now by using the monitoring service, you can configure notifications for all the metrics of a Java application. That way you can be notified for any critical CPU and memory usage in addition to the custom metrics and availability checks. Furthermore, you can even customize the way these notifications are sent. For example, the monitoring service can send an email when a metric is detected as critical for the first time and an SMS when it is received as critical three times. Another benefit with such a scenario is that you can be notified for critical metrics of many Java applications located in subaccounts on different hosts (regions). The only requirement in such a case is that your user is a member of those subaccounts.

To use the monitoring service in such a scenario, you just need to develop a notification application that checks for a critical metric and sends notifications through email, SMS, or other channel. To use a channel other than email, you have to configure your server to support it.

This blog describes a scenario in which notifications are sent via email or SMS and assumes that you have configured your server for SMS notifications. A separate tutorial describes in detail how you can develop your notification application in Java (see Tutorial: Implementing a Notification Application).

 

Process Flow


The communication between your notification application and the monitoring service works as follows:



  1. A notification application requests metrics of an SAP Cloud Platform Java application from the monitoring service with a REST API call every minute.Note: The calls are sent per minute because the Java application metrics are refreshed each minute.For more information about the REST call, see Monitoring API.

  2. The monitoring service sends back a JSON response with a status code 200 OK.The response contains the metrics of the requested application and the states of these metrics.

  3. The notification application parses the JSON response and checks for critical metrics.

  4. The notification application notifies you by the following conditions:

    1. A metric is critical for the first time – you receive a notification email.

    2. A metric is critical three times – you receive an SMS.



  5. The notification application checks if metrics have been critical three times and takes actions for application self-healing (for example, the Java application is restarted).

  6. The notification application repeats steps 1 to 5 for all other Java applications.


 

Example


Julie Armstrong, as an operator of Company A, would like to configure a notification application that will send her notification alerts for critical metrics of her running Java applications. These Java applications are located in the US and Europe regions. In addition, she decides that when critical metrics are received, the application has to be restarted. For that purpose, she develops a notification application in Eclipse following the instructions in Tutorial: Implementing a Notification Application.

 

 

Although this blog describes only the notification and self-healing scenario, you can extend this scenario to use a dashboard application or another tool that displays the metrics of SAP Cloud Platform Java applications. For more information about the dashboard application scenario, see Use the Monitoring Service to Retrieve Metrics from Different SAP Cloud Platform Applications.

 

More Information


Monitoring Java Applications


 

6 Comments