A preface

Knowledge seeker Springboot series article added a article, Springboot background application monitoring, hope the majority of readers support, a lot of attention praise; If you have not studied the article of exposing the endpoints of the Actuator, you are advised to consult the knowledge Seeker column to learn.

Springboot Admin introduction

SpringBoot Admin is an open source community project to manage and monitor SpringBoot applications; The way it works is that the Spring Boot Admin Client is found either by registering for the Spring Boot Admin Server (over HTTP) or using a SpringCloud registry (e.g. Eureka, Consul); This article should be springboot series, will not involve Springloud, please do not worry about learning;

Main features:

Rewrite the UI interface using vue.js

The server uses Spring WebFlux + Netty

Integrated Spring Security-based authentication

Monitoring support for session endpoint

Main Function Description:

  1. Monitor the overview information during application running.
  2. Metrics, such as JVM, Tomcat, and process information;
  3. Environment variable information, such as system properties, system environment variables, and application configuration information;
  4. View information about all created beans.
  5. View all configuration information about an application.
  6. View application run logs.
  7. View JVM information;
  8. View accessible Web endpoints;
  9. View HTTP tracing information.

Three depend on

Springboot version 2.1.1, this will directly integrate the server, client into a project, readers can also be the client,server project separation, attention is client,server version number to be consistent;

<dependencies> <! <dependency> <groupId>de. Codecentric </groupId> < artifactId > spring - the boot - admin - starter - server < / artifactId > < version > 2.1.6 < / version > < / dependency > <! <dependency> <groupId>de. Codecentric </groupId> < artifactId > spring - the boot - admin - starter - client < / artifactId > < version > 2.1.6 < / version > < / dependency > < the dependency > <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>Copy the code

Four application. Yml

The client registers with the server. Because it is in the same application, the client registers with itself directly. Otherwise, the URL must be changed to the server address.


server:
  port: 9999

spring:
  boot:
    admin:
      client:
        url: 'http://localhost:9999'

management:
  endpoints:
    web:
      exposure:
        include: "*"
  endpoint:
    health:
      show-details: ALWAYS
Copy the code

Five Application

If @enableadminServer is added to the startup class, the background monitoring application is enabled

/** * @Author lsc * <p> </p> */ @EnableAdminServer @SpringBootApplication public class AdminApp { public static void main(String[] args) { SpringApplication.run(AdminApp.class, args); }}Copy the code

Vi Display Results

Access address localhost:9999 In the case of a client, the server separated access is the address of the server

Click wallboard to display various monitoring information;