SpringBoot Twenty-four: Application Monitoring of Admin

Author: Dream 1819
Original: https: //www.cnblogs.com/yanfei1819/p/11457867.html
Copyright: This article is a blogger original article, reproduced, please attach Bowen link!


introduction

  Previous chapter (Chapter 22. SpringBoot: Application Monitoring of Actuator) describes the use of Actuctor SpringBoot application monitoring. Finally, the article also raises the question, Is it possible to monitor the results show a better operation and maintenance of the students?

  This chapter answers this question.

  Spring Boot Admin is a management and monitoring of Spring Boot application of open source projects. Into the admin-server admin-client two components, collected actuator by admin-server endpoint data, displayed on the spring-boot-admin-ui, almost all known endpoints acquisition, by spring-boot-admin dynamic switching log level, the log export, export heapdump, monitoring indicators and so on.

  Spring Boot AdminWhile a single application service monitoring also provides a cluster monitoring program, supported by the eureka, consul, zookeeperand other ways registry of multi-service monitoring and management.


Use of SpringBoot Admin


Create admin-server

First, the introduction of maven dependent on:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
    <groupId>de.codecentric</groupId>
    <artifactId>spring-boot-admin-starter-server</artifactId>
</dependency>
<dependency>
    <groupId>de.codecentric</groupId>
    <artifactId>spring-boot-admin-server-ui</artifactId>
</dependency>

For convenience of distinction, the port number is defined as 8081:

server.port=8081

Annotated on the startup class @EnableAdminServer.

which is:

package com.yanfei1819.adminserver;

import de.codecentric.boot.admin.server.config.EnableAdminServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

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


Let's come to feel SpringBoot Admin interface:

Page has no content, created to monitor the client below.


Create admin-client

Introducing maven dependence:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
    <groupId>de.codecentric</groupId>
    <artifactId>spring-boot-admin-starter-client</artifactId>
</dependency>

Set its port number is 8082:

server.port=8082
spring.boot.admin.client.url=http://localhost:8081
# 激活所有的端点的web方式请求。如果不激活,将看不到详细的监控信息。
management.endpoints.web.exposure.include=*


First start the admin-server, and then start the admin-client.

Here are the some of the interface:

Home monitoring:

Applications:

Execution log:

details:


In the above interface, including almost all of the monitoring information. Interested readers can learn more individually. Due to limited space here, not as a developing process.

If you need to monitor multiple client-side information, just in the client configuration file application.properties configure:

spring.boot.admin.client.url=http://localhost:8081
# 激活所有的端点的web方式请求。如果不激活,将看不到详细的监控信息。
management.endpoints.web.exposure.include=*

Source chapter wrote two clients, in order to simplify the text only demonstrates a.


to sum up

  Just above article introduces the application SpringBoot Admin in the actual project, you can do the security authentication, permissions, and even message notification.

  So far, this series has been written twenty-four. Feeling all the way down is used by more than a simple understanding. The most important thing is understanding, understanding ideology, theory (of course, this series is due for entry SpringBoot learners, in terms of the principle of not-depth Detailed Follow-up will open another series, specializing in analytical principle), in order to use them handy, having problems rather than just copy, paste, asked the degree of your mother.

  He said an aside. This is a time and on a longer distance. The main author during this time to learn a bit about distributed, highly concurrent, and MySQL knowledge of these three points. Followed by a time for everyone to want to share them.

  Finally, welcome Gangster Paizhuan.


ps: This series of source address .



Guess you like

Origin www.cnblogs.com/yanfei1819/p/11457867.html