一.新建spring boot项目
二.pom.xml添加依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
三.启动项目
四.访问http://localhost:8080/actuator
五./health 作用 健康检查,可以检查很多资源情况,添加配置查看更多信息
management.endpoint.health.show-details=always
启动服务,访问http://localhost:8080/actuator/health,status的取值:1.UP:正常 2.DOWN:不正常 3.out-of-service:不该使用 4.unknow:不知道
六./info端点,描述应用,配置文件配置
info.app-name=spring-boot-actuator info.author=wang info.email=xxxx@qq.com
访问http://localhost:8080/actuator/info
七.Spring boot 文档https://docs.spring.io/spring-boot/docs/2.1.5.RELEASE/reference/htmlsingle/,激活全部健康端点
配置:
management.endpoints.web.exposure.include=*
重启动服务,访问http://localhost:8080/actuator