spring boot actuator

115 阅读1分钟

基于spring boot

2.3.1.RELEASE

1.引入jar包依赖
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

2.文件增加配置##默认端点都开启
management.endpoints.enabled-by-default=true
##开启端点范围(必须配置,如果不配置,则访问不到)
management.endpoints.jmx.exposure.include=*
management.endpoints.web.exposure.include=*

##不加这个配置,访问health端点,只显示简要信息
management.endpoint.health.show-details=always