服务监控功能整合v2

door
LI-CCONG\李聪聪 7 months ago
parent f1b823659a
commit 47f7d3a5d4

@ -0,0 +1,46 @@
<?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>
<groupId>cc.yunxi</groupId>
<artifactId>nxhs-monitor</artifactId>
<version>1.0-SNAPSHOT</version>
<description>宁夏回收应用监控平台</description>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-boot.version>2.7.6</spring-boot.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- SpringBoot 标准依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<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>
<version>${spring-boot.version}</version>
</dependency>
</dependencies>
</project>

@ -0,0 +1,21 @@
package cc.yunxi;
import de.codecentric.boot.admin.server.config.EnableAdminServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import javax.annotation.PreDestroy;
@SpringBootApplication
@EnableAdminServer
public class MonitorApplication {
public static void main(String[] args) {
SpringApplication.run(MonitorApplication.class, args);
}
@PreDestroy
public void PreDestroy(){
System.out.println("MonitorApplication Shutdown...");
}
}

@ -0,0 +1,10 @@
server:
port: 9100
info:
name: 宁夏回收应用服务监控
spring:
application:
# 应用名称
name: nxhs-monitor

@ -45,8 +45,8 @@
</dependency>
<!-- 服务监控 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
</dependency>
</dependencies>

@ -1,6 +1,29 @@
server:
port: 8080
management:
endpoints:
web:
base-path: /monitor
exposure:
include: '*'
endpoint:
health:
show-details: always # 开启健康检查的完整信息
shutdown:
enabled: true
info:
enabled: true
info: #配置info信息
env:
enabled: true
info:
name: 宁夏回收应用服务
domain: 'https://nxhs.cjyx.cc'
version: 0.0.1
describe: '推动家电以旧换新活动和绿色智能家电下乡、支持废旧家电回收……'
spring:
application:
name: nxhs-service
@ -11,6 +34,15 @@ spring:
enabled: true #是否启用分段上传支持
profiles:
active: dev
boot:
admin:
client:
url: http://localhost:9100
instance:
name: ${spring.application.name}
service-url: http://localhost:${server.port}
# username: admin
# password: admin123
datasource:
url: jdbc:mysql://127.0.0.1:3306/nxhs?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
driver-class-name: com.mysql.cj.jdbc.Driver
@ -46,6 +78,7 @@ logging:
dateformat: yyyy-MM-dd HH:mm:ss:SSS
file:
path: "${user.dir}/logs/${spring.application.name}"
name: "${logging.file.path}/log_debug.log"
knife4j:
enable: true

Loading…
Cancel
Save