赞
踩
Actuator
是SpringBoot
中的重要组件,为应用程序提供了强大的监控能力
pom.xml
<!-- actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
actuator
的端点/health
端点的作用:健康检查
访问health
端点
status
的取值UP:正常
DOWN:遇到了问题,不正常
OUT_OF_SERVICE:资源正在使用,或者不该去使用
UNKNOWN:不知道
health
端点详情展示,配置application.yml
# Actuator配置
management:
endpoint.health.show-details: always # health端点详情展示
health
端点application.yml
激活所有端点management:
endpoint.health.show-details: always # health端点详情展示
endpoints:
web:
exposure:
include: "*" # 激活所有端点
# include: metrics, health # 激活metrics, health端点
info
端点是描述性端点application.yml
# info端点描述应用
info:
app-name: user-center
author: Coisini
email: xxx.email
Actuator
默认提供了许多端点,具体如下,这里不一一举例了Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。