Spring-boot: actuator default endpoints

Actuator is a sub-project of Spring-boot, which provides production ready features for spring-boot applications. It provides a number of additional features to monitor and manage the application when it pushes to production.

You can try it out by clone the spring-boot github repo, and navigate to the spring-boot-samples directory which contains plenty of built-in samples, you can find one that is called spring-boot-sample-actuator-log4j2, and run the command `mvn spring-boot:run` to bring up the spring boot application. 

Screen Shot 2016-07-03 at 10.41.36 AM

As you can see, there is not really any code in the project where defines this autoconfig endpoint. This “autoconfig”one might not be the most interesting or straightforward one, but it is actually a really important and sophisticated one which displays the auto-configuration report of all the auto configuration report, also which one is applied or not and why.

You can refer to spring-boot-actuator documentation for a complete list of the available endpoints. Here are a few ones that I tried out myself along with some description and screenshots to help you understand how that works in real life:

1.configprops – configuration properties

Screen Shot 2016-07-03 at 10.53.20 AM.png

2.health – heath status

application health information

Screen Shot 2016-07-03 at 11.05.00 AM

3. metrics – metrics of current application

If you are in a production environment, i think you should care every number in the response.

Screen Shot 2016-07-03 at 11.08.48 AM.png

4. mappings – display a collated list of all paths

Screen Shot 2016-07-03 at 11.14.37 AM

I pasted the response to a site called jsonlint to put it in a better format for human to read.

Screen Shot 2016-07-03 at 11.14.17 AM

5. shutdown – make a post to the server to shutdown

This is quite a dangerous endpoint that a post request to the server will shut it down.

Screen Shot 2016-07-03 at 11.19.02 AM.png

Well… here they are, enjoy the awesome work done and appreciate it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s