An overview of the
In my previous article, “Spring Boot Application Monitoring in Action,” I explained how to use the Spring Boot Admin 1.5.x release to visually monitor Spring Boot applications. Now that Spring Boot Admin has been updated to version 2.0, you can monitor the current hot Spring Boot 2.0 and Spring Cloud Finchley.RELEASE, so here’s a look and see!
Note: This article is published on My official account CodeSheep. You can long press or scan the following note to subscribe ↓ ↓
New features of Spring Boot Admin 2.0
Spring Boot Admin 2.0 has a lot of changes, please refer to the official website for details, here are a few main:
-
I rewrote the UI with vue. js, too pretty to be real
-
Spring Security-based authentication is directly integrated without introducing third-party modules
-
Added the monitoring support for session endpoint
And so on…
Here is the actual test to feel the operation!
Set up the Spring Boot Admin Server
- Create a SpringBoot 2.0.3 RELEASE project and add dependencies
<dependencies> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-server</artifactId> < version > 2.0.1 < / version > < / dependency > < the dependency > < groupId > DE. Codecentric < / groupId > < artifactId > spring - the boot - admin server - UI < / artifactId > < version > 2.0.1 < / version > < / dependency > < the dependency > <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies>Copy the code
- Apply the main class to add annotations
@SpringBootApplication
@EnableAdminServer
public class SbaServer20Application {
public static void main(String[] args) {
SpringApplication.run(SbaServer20Application.class, args);
}
}
Copy the code
- Start the Spring Boot Admin Server
Browser open localhost:8080, you can see the small fresh page
As you can see, this UI change is a far cry from the 1.5.X era, when the number of monitored apps was 0.
Let’s create an example of Spring Boot 2.0 to monitor.
Example Create the Spring Boot Admin Client
Again, we create a Spring Boot 2.0.3.RELEASE application and add it to the Spring Boot Admin for monitoring
- Add dependencies to POM.xml
<dependencies> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-client</artifactId> < version > 2.0.1 < / version > < / dependency > < the dependency > < groupId > org. Springframework. Boot < / groupId > <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies>Copy the code
- Editing a Configuration File
server.port=8081
spring.application.name=Spring Boot Client
spring.boot.admin.client.url=http://localhost:8080
management.endpoints.web.exposure.include=*
Copy the code
- Example Start the Spring Boot Admin Client
At this point, the message that the application is online is pushed to the Spring Boot Admin page:
The actual experiment
Once the monitored application is online, we go to the Spring Boot Admin page to play around with it
- Wallboard is a little fresh
- An overview of the Applications
- The Applications online log is clear
- Applications Details
- Metrics
- Environment
- JMX
- Threads
- Http Traces
Afterword.
-
More of the author’s original articles here, welcome to watch
-
My Personal Blog
The author’s more SpringBt practice articles are here:
- Spring Boot application monitoring in action
- The SpringBoot application is deployed in an external Tomcat container
- ElasticSearch search engine in SpringBt practice
- Preliminary study on Kotlin+SpringBoot joint programming
- Spring Boot Logging framework practices
- SpringBoot Elegant Coding: Lombok Blessing
If you are interested, you can also take a look at some of the author’s articles on containerization and microservitization:
- Using K8S technology stack to build personal private cloud serials
- Detail the Nginx server configuration from a configuration list
- Construction of visual monitoring center of Docker container
- Build the Docker container application log center with ELK
- RPC framework practice: Apache Thrift
- RPC Framework Practice: Google gRPC
- Set up tracing center of microservice invocation chain
- Docker containers communicate across hosts
- Preliminary study on Docker Swarm cluster
- A few guidelines for writing Dockerfiles efficiently