5

Monitor your Spring Boot applications with Actuator

 3 years ago
source link: https://marco.dev/2017/03/08/monitor-your-spring-boot-applications-with-actuator/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

java-version.com: What's new in Java 16? 15? Keep up to date!

Monitor your Spring Boot applications with Actuator

When you have deployed many applications in your server / cloud it’s not easy to monitor their individual status.

You should verify that the server, the application and the database are working correctly.

Spring Boot help us to go in the direction of an automatic control of the status of the application exposing (on request) many information about it.

If you use the @SpringBootApplication annotation in your Application class and you add the Actuator dependency to your maven dependencies

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

Spring generates for you a lot of predefined endpoints (accessible via REST) with a lot of internal information of the application: memory, beans, etc.

You can find the list of the endpoints here: https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html

The type and quantity of information can be configured. This endpoints allow us to use external tools (e.g. regular ping or analysis of the JSON response) to create status dashboards and monitor if everything is working correctly or an intervention is required.

Spring cleverly hides some sensitive fields like ‘password’ automatically and it can cache the results to reduce the impact of DDoS attacks.

You can see some examples of the result on my sample website:

https://angular.cafe/app-spring-monitoring

monitoring_2.png?resize=106%2C138

monitoring_1.png?resize=300%2C475

Author

Marco Molteni

Marco Molteni Blog


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK