一.添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
二.配置
server:
port: 80
spring:
application:
name: order-service
eureka:
client:
service-url:
defaultZone:
http://localhost:8761/eureka/
management:
endpoints:
web:
exposure:
# include: "*" 开启所有端点
include:
- health
- info
- env
- beans
- shutdown #POST
endpoint:
health:
show-details: always #显示完整的应用健康数据
shutdown:
enabled: true
本文详细介绍如何在Spring Boot项目中使用Actuator依赖,通过配置开启监控端点,包括健康检查、应用程序信息、环境变量、bean实例等,以及如何设置详细的应用健康数据展示和关闭应用的端点。
1574

被折叠的 条评论
为什么被折叠?



