diff --git a/user-service-project/user-service-app/pom.xml b/user-service-project/user-service-app/pom.xml index 9675294bc..230f662c6 100644 --- a/user-service-project/user-service-app/pom.xml +++ b/user-service-project/user-service-app/pom.xml @@ -29,6 +29,12 @@ user-service-api + + + org.springframework.boot + spring-boot-starter-web + + com.alibaba.cloud @@ -59,6 +65,12 @@ mall-spring-boot-starter-mybatis + + + org.springframework.boot + spring-boot-starter-actuator + + org.springframework.boot @@ -81,4 +93,16 @@ + + + ${project.artifactId} + + + + org.springframework.boot + spring-boot-maven-plugin + + + + diff --git a/user-service-project/user-service-app/src/main/resources/application.yaml b/user-service-project/user-service-app/src/main/resources/application.yaml index 3ee3026cb..812b2b658 100644 --- a/user-service-project/user-service-app/src/main/resources/application.yaml +++ b/user-service-project/user-service-app/src/main/resources/application.yaml @@ -44,3 +44,9 @@ dubbo: consumer: OAuth2Rpc: version: 1.0.0 + +# Actuator 监控配置项 +management: + server.port: 38081 # 独立端口,避免被暴露出去 + endpoints.web.exposure.include: '*' # 暴露所有监控端点 +server.port: ${management.server.port} # 设置使用 Actuator 的服务器端口,因为 RPC 服务不需要 Web 端口