Spring Admin Server and UI for Spring Boot Application – 1

The one of best parts of the Spring boot  is it have some great tools can add on to your application to have basic feature of a production system. Beside last time swagger for Spring boot, this time we add the Spring Admin Server to the application.

To monitoring your system health, you need to create a admin server ruuning as a standalone application, eg at port 8081 this time. So from this server , we can admin all the spring boot applications’ health.

We will first create a new app to run the admin server first.

1. Create a new Spring boot app with “web” enabled.

2. Add this to pom.xml


3. Add this to the application.properties



4. Just add the @EnableAdminServer to the application main class:

public class MonitorApplication {

public static void main(String[] args) {
 SpringApplication.run(MonitorApplication.class, args);

Ok , sever is ready, start it and surf to http://localhost:8081  you will see the Admin UI but with no application be monitored there.


Now let change one app as the client that will be monitored by admin.

1. Add the dependency in pom.xml, bold text part!

<!-- Spring admin UI client ===================================================== -->
 <!-- Spring admin UI client ===================================================== -->

2. Add this to the application.properties, as our admin server running at 8081

# =======================================================================================
# For Spring Admin UI client side
# =======================================================================================
spring.boot.admin.url = http://localhost:8081 
management.security.enabled: false

3. All done, just start our app, it is running at 8082 port.  then go back to admin server UI, we will see it auto has one application be monitored!

Screenshot from 2018-04-27 14-37-35


And we can check all health info about our client applications from here:

Screenshot from 2018-04-27 14-37-43.png

Bingo. have a rest and we will proceed to the security login part!


Thanks for this link about some process and basics.