Skip to main content

Digital Transformation

Spring Boot Actuator – Application Monitoring Made Easy

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:
acutator

2.autoconfig – This display auto-configuration report for your application
Sample Screenshot:
autoconfig
3.beans – Display all beans in your application
Sample Screenshot:
beans
4.configprops – Display the configuration properties that are defined by the @ConfigurationProperties beans.
Sample Screenshot:
configprops
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:
docs
6.dump – Display thread dump. For e.g. running thread, stacktrace etc.
Sample Screenshot:
dump
7.env – Display all the properties from the Spring’s ConfigurableEnvironment.
Sample Screenshot:
env
8.health – Display application health information like status, diskspace etc.
Sample Screenshot:
health
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:
metrics
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:
info
11.mappings – Display all the mapping for RequestMapping.
Sample Screenshot:
mappings
12.trace – Display trace information. For e.g. request made.
Sample Screenshot:
trace
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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Susheel Kumar

More from this Author

Follow Us
TwitterLinkedinFacebookYoutubeInstagram