Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (32 sloc) 2.12 KB
id title date author layout guid permalink image categories tags
1024
Monitor your Spring Boot applications with Actuator
2017-03-08 00:09:26 +0000
Marco Molteni
post
/2017/03/08/monitor-your-spring-boot-applications-with-actuator/
/wp-content/uploads/2017/03/header-springboot-100x23.png
Spring
actuator
java
spring

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: http://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:

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