一.添加依赖
<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