1.

What is a Spring Boot Admin? How do you configure it?

Answer»

Spring Boot Admin is a web application that is used for Spring Boot applications management and monitoring. Each application is considered a client and registers to Spring Boot Admin Server. The Spring Boot Actuator endpoints give the magic behind the SCENES.

&LT;dependency&GT;     <groupId>de.codecentric</groupId>     <artifactId>spring-boot-admin-server</artifactId>     <version>2.1.6</version> </dependency> <dependency>     <groupId>de.codecentric</groupId>     <artifactId>spring-boot-admin-server-ui</artifactId>     <version>2.1.6</version> </dependency>

With this, what you get for free is @EnableAdminServer, so let’s use this.

@EnableAdminServer @SpringBootApplication PUBLIC class MySpringBootAdminApp {     public static void main(String[] args) {         SpringApplication.run(MySpringBootAdminApp.class, args);     } }

This sets up our admin server.

Start the Admin Server and see if it is available at localhost:8080/admin/

Now, in your client application , we need a corresponding client which will register to this admin server. Use following in your client application.

<dependency>     <groupId>de.codecentric</groupId>     <artifactId>spring-boot-admin-starter-client</artifactId>     <version>2.1.6</version> </dependency>

Now on the client SIDE, you also need to provide the url where admin server is running. Configure following in your client application’s application.properties:

spring.boot.admin.url=http://localhost:8080

Spring Boot Admin can be configured to only show the data we deem helpful. We just need to change the default setup and add our own required metrics.

For this configure following in application.properties of Spring Boot Admin Server.

spring.boot.admin.routes.endpoints=env, metrics, trace, Jolokia, info, configprops



Discussion

No Comment Found