Spring Boot Actuator helps you manage and monitor your applications using various way like HTTP, JMX and SSH. It allows you to monitor various aspects of your application.
Actuator exposes various endpoint to provides different details about environment and application. Following are the endpoints exposed.
All the endpoint can be accessed using <host>:port/endpoint for e.g. http://localhost:8080/info , http://localhost:8080/health
1.actuator – This display all the endpoint available. This is disabled by default though. To enable this you need to add spring-hateoas dependency in your application pom.xml
<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
</dependency>
Sample Screenshot:
2.autoconfig – This display auto-configuration report for your application
Sample Screenshot:
3.beans – Display all beans in your application
Sample Screenshot:
4.configprops – Display the configuration properties that are defined by the @ConfigurationProperties beans.
Sample Screenshot:
5.docs – Display documentation for spring actuator. Need acutator-docs dependency in application pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator-docs</artifactId>
</dependency>
Sample Screenshot:
6.dump – Display thread dump. For e.g. running thread, stacktrace etc.
Sample Screenshot:
7.env – Display all the properties from the Spring’s ConfigurableEnvironment.
Sample Screenshot:
8.health – Display application health information like status, diskspace etc.
Sample Screenshot:
9.metrics – Display metrics of the current application. For e.g. memory used, memory available, uptime of your application, number of threads etc.
Sample Screenshot:
10.info – display information about application. Custom value can be configured in application.properties file. See example below.
info.app.name=Spring Boot Web Actuator Application
info.app.description=This is an example of the Actuator module
info.app.version=1.0.0
Sample Screenshot:
11.mappings – Display all the mapping for RequestMapping.
Sample Screenshot:
12.trace – Display trace information. For e.g. request made.
Sample Screenshot:
13.flyway – Display information about database migration scripts
14.liquidbase – Display liquidbase database migration if applied. To enable this endpoint add following liquibase-core dependency in your application pom.xml
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
</dependency>
15.logfile – Returns the contents of the logfile. Logfile should be specified in application.properties file usinf logging.file or logging.path
16.shutdown – Shutdown application. By default it is not enabled. To enable this endpoint add following in application.properties
endpoints.shutdown.enabled=true