Spring Boot Admin is an application that manages and monitors your Spring Boot applications. These applications are registered via the Spring Boot Admin Client (via HTTP) or discovered using Spring Cloud (such as Eureka). The UI is just an AngularJs application on the Spring Boot Actuator endpoint.
Start quickly
First, create a SpringBoot project in IDEA and treat it as the server side. The project is as follows:
Then introduce dependencies in pom.xml:
<dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-server</artifactId> <version>1.5.6</version></dependency><dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-server-ui</artifactId> <version>1.5.6</version></dependency>
Continue to introduce the annotation @EnableAdminServer in the startup class SpringbootAdminApplication.java, and then run the project:
Just visit http://localhost:8084/:
At this point, you will find that there is no information about the application.
Next, we create a new SpringBoot project and treat it as a client program. The project is as follows:
Add dependencies in pom.xml:
<dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-client</artifactId> <version>1.5.6</version></dependency>
Then set it in application.yml:
spring.boot.admin.url=http:localhost:8094 is used to register the current application with Spring Boot Admin.
You can also set it, spring.boot.admin.client.name: (the name of the application) If it is not set, there will be a default name.
Now run the two projects:
Click the detail button in the figure: you can see the application's health value, memory, JVM, GC and other information.
metrics information:
Environmental information:
log information:
JMX Information:
Thread information:
Trace Tracking Information:
You can also download the Heapdump file.
There is a red × behind the application list on the home page just now. We can remove the registered application, but as long as you don’t stop the program, it will register again immediately.
There is also the version and info of the application list. The above diagram is empty. Let’s see how to change it:
info.groupId: @[email protected]: @[email protected]: @project.version@
Rerun the client program and refresh the page to find:
You can also query the application's event changes:
Client Application
JMX bean management
To interact with JMX-beans in the admin interface, you must include Jolokia in the client application,
pom.xml adds dependencies:
<dependency> <groupId>org.jolokia</groupId> <artifactId>jolokia-core</artifactId></dependency>
After restarting the client program, you can interact with JMX here:
There are also many SpringBoot Admin client configuration options:
http://codecentric.github.io/spring-boot-admin/1.5.6/#spring-boot-admin-client
Server-side program
There are also some SpringBoot Admin server program configuration options:
http://codecentric.github.io/spring-boot-admin/1.5.6/#spring-boot-admin-server
There is also some knowledge about service offline notifications in the official document. If you want to know, you can check it out:
http://codecentric.github.io/spring-boot-admin/1.5.6/#_notifications
The above is all the content of this article. I hope it will be helpful to everyone's learning and I hope everyone will support Wulin.com more.