diff --git a/jsowell-admin/pom.xml b/jsowell-admin/pom.xml index f50a9c149..2a13837f9 100644 --- a/jsowell-admin/pom.xml +++ b/jsowell-admin/pom.xml @@ -131,6 +131,14 @@ org.apache.dubbo dubbo-registry-nacos + + org.springframework.boot + spring-boot-starter-actuator + + + io.micrometer + micrometer-registry-prometheus + diff --git a/jsowell-admin/src/main/resources/application.yml b/jsowell-admin/src/main/resources/application.yml index d2f6547e7..14666548c 100644 --- a/jsowell-admin/src/main/resources/application.yml +++ b/jsowell-admin/src/main/resources/application.yml @@ -1,7 +1,7 @@ # 项目相关配置 jsowell: # 名称 - name: jsowell-service + name: wcc-service # 版本 version: 1.0.0 # 版权年份 @@ -51,6 +51,8 @@ user: # Spring配置 spring: + application: + name: jsowell-charger-web # 资源信息 messages: # 国际化资源文件路径 @@ -71,6 +73,21 @@ spring: # 热部署开关 enabled: true +# 监控配置 +management: + server: + port: 8091 + endpoints: + web: + exposure: + include: '*' + metrics: + tags: + application: ${spring.application.name} + export: + prometheus: + enabled: true + # MyBatis配置 mybatis: # 搜索指定包别名 diff --git a/jsowell-framework/src/main/java/com/jsowell/framework/config/SecurityConfig.java b/jsowell-framework/src/main/java/com/jsowell/framework/config/SecurityConfig.java index 0f101dd1f..23458e50d 100644 --- a/jsowell-framework/src/main/java/com/jsowell/framework/config/SecurityConfig.java +++ b/jsowell-framework/src/main/java/com/jsowell/framework/config/SecurityConfig.java @@ -110,6 +110,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() + .antMatchers("/actuator/**").permitAll() // 除上面外的所有请求全部需要鉴权认证 .anyRequest().authenticated() .and() diff --git a/pom.xml b/pom.xml index e74a7474b..84ce530c9 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ 0.9.1 1.18.24 20.0 - 2.5.14 + 2.5.14 4.1.75.Final 1.2.5 1.2.5 @@ -57,11 +57,23 @@ org.springframework.boot spring-boot-dependencies - 2.5.14 + ${spring.boot.version} pom import + + org.springframework.boot + spring-boot-starter-actuator + 2.5.14 + + + + io.micrometer + micrometer-registry-prometheus + 1.7.12 + + com.alibaba @@ -229,7 +241,7 @@ org.springframework.boot spring-boot-starter-test - ${spring.boot.test.version} + ${spring.boot.version} @@ -389,6 +401,8 @@ nacos-client ${nacos-client.version} + +