Spring Boot集成 Spring Boot Admin 監(jiān)控
【前言】
程序開(kāi)發(fā)完實(shí)現(xiàn)相應(yīng)的功能只是一個(gè)部分,如何讓系統(tǒng)在線上運(yùn)行更好創(chuàng)造更高的價(jià)值是另外一個(gè)部分;監(jiān)控是一個(gè)生產(chǎn)級(jí)項(xiàng)目避不可少重要組成部分;最近研究一下針對(duì)SpringBoot的監(jiān)控項(xiàng)目---Spring Boot Admin,并集成項(xiàng)目中,在此與大家共享;
【SpringBootAdmin】
一、SpringBootAdmin簡(jiǎn)介
1、github地址:https://github.com/codecentric/spring-boot-admin
2、重要功能列表:

二、項(xiàng)目中集成SpringBootAdmin
1、搭建SpringBootAdmin服務(wù)端
(1)新建springboot項(xiàng)目(在此項(xiàng)目名定為zh-monitor)
(2)pom文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.zhanghan</groupId>
<artifactId>zh-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>com.zhanghan</groupId>
<artifactId>zh-monitor</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>zh-monitor</name>
<description>zhanghan monitor for Spring Boot</description>
<dependencies>
<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>
</dependencies>
<build>
<finalName>zh-monitor</finalName>
</build>
</project>
(3)啟動(dòng)類(lèi)如下(ZhMonitorApplication):
/*
* Copyright (c) 2019. zhanghan_java@163.com All Rights Reserved.
* 項(xiàng)目名稱(chēng):實(shí)戰(zhàn)SpringBoot
* 類(lèi)名稱(chēng):ZhMonitorApplication.java
* 創(chuàng)建人:張晗
* 聯(lián)系方式:zhanghan_java@163.com
* 開(kāi)源地址: https://github.com/dangnianchuntian/springboot
* 博客地址: https://zhanghan.blog.csdn.net
*/
package com.zhanghan.zhmonitor;
import de.codecentric.boot.admin.server.config.EnableAdminServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@EnableAdminServer
public class ZhMonitorApplication {
public static void main(String[] args) {
SpringApplication.run(ZhMonitorApplication.class, args);
}
}
(4)配置文件如下(application.properties):
server.port=8091 spring.application.name=zhMonitor
2、SpringBoot項(xiàng)目集成SpringBootAdmin客戶端
(1)Pom中增加相關(guān)依賴(lài)
<!-- spring boot admin begin --> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-client</artifactId> </dependency> <!-- spring boot admin end -->
(2)啟動(dòng)配置文件中增加連接服務(wù)端地址

三、部分功能效果展示:
1、詳細(xì)指標(biāo)

2、Log日志級(jí)別管理

3、JVM線程

4、Web中http展示

四、項(xiàng)目地址:
1、地址:https://github.com/dangnianchuntian/springboot
2、代碼版本:1.5.0-Release
【總結(jié)】
1、工欲善其事必先利其器,監(jiān)控為系統(tǒng)保駕護(hù)航,讓系統(tǒng)運(yùn)行的更加穩(wěn)定,發(fā)揮更大的業(yè)務(wù)價(jià)值;
2、接下來(lái)會(huì)為大家共享更多關(guān)于SpringBootAdmin的特性。
到此這篇關(guān)于Spring Boot集成 Spring Boot Admin 監(jiān)控的文章就介紹到這了,更多相關(guān)Spring Boot Admin 監(jiān)控內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
intellij idea 啟動(dòng)tomcat 1099端口被占用的解決
這篇文章主要介紹了intellij idea 啟動(dòng)tomcat 1099端口被占用的解決,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2019-09-09
java實(shí)現(xiàn)mysql操作類(lèi)分享 java連接mysql
這篇文章主要介紹了java實(shí)現(xiàn)的mysql操作類(lèi)示例,大家在連接數(shù)據(jù)的時(shí)候可以直接使用了2014-01-01
MyBatis之自查詢(xún)使用遞歸實(shí)現(xiàn) N級(jí)聯(lián)動(dòng)效果(兩種實(shí)現(xiàn)方式)
這篇文章主要介紹了MyBatis之自查詢(xún)使用遞歸實(shí)現(xiàn) N級(jí)聯(lián)動(dòng)效果,本文給大家分享兩種實(shí)現(xiàn)方式,需要的的朋友參考下吧2017-07-07
Spring Task定時(shí)任務(wù)的實(shí)現(xiàn)詳解
這篇文章主要介紹了SpringBoot定時(shí)任務(wù)功能詳細(xì)解析,這次的功能開(kāi)發(fā)過(guò)程中也算是對(duì)其內(nèi)涵的進(jìn)一步了解,以后遇到定時(shí)任務(wù)的處理也更清晰,更有效率了,對(duì)SpringBoot定時(shí)任務(wù)相關(guān)知識(shí)感興趣的朋友一起看看吧2022-08-08
Java實(shí)現(xiàn)控制小數(shù)精度的方法
這篇文章主要介紹了Java實(shí)現(xiàn)控制小數(shù)精度的方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2021-01-01
SpringBoot集成tensorflow實(shí)現(xiàn)圖片檢測(cè)功能
TensorFlow名字的由來(lái)就是張量(Tensor)在計(jì)算圖(Computational?Graph)里的流動(dòng)(Flow),它的基礎(chǔ)就是前面介紹的基于計(jì)算圖的自動(dòng)微分,本文將給大家介紹Spring?Boot集成tensorflow實(shí)現(xiàn)圖片檢測(cè)功能,需要的朋友可以參考下2024-06-06
springboot+redis+阿里云短信實(shí)現(xiàn)手機(jī)號(hào)登錄功能
通過(guò)Java實(shí)現(xiàn)添加或刪除PDF中的附件

