我们一开始说了Spring Boot的四大特性 编码 ,配置 ,监控 ,部署

下面我们说一下它的第三个特性:监控

我们这一节先讲actuator监控

1.pom文件引入actuator监控所需要的jar包

<!--监控中心的jar包-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

2.查看springboot的启动日志

这些就是监控的地址

13-Spring Boot (采用actuator监控spring boot的健康 )

3.如何使用地址查看?

非常简单,我们直接通过这些网址,比如查看健康状态,我们在浏览器中直接输入 http://localhost:8090/lizhen123/health 就可以了

如图:

13-Spring Boot (采用actuator监控spring boot的健康 )

我们在看一下类的信息,返回过来的信息其实就是json字符串的形式

13-Spring Boot (采用actuator监控spring boot的健康 )


我们看到这些字符串很难读,那么有没有方法可以解决呢,其实还有另一种监控,它将这些信息转化为图形,观赏和读取都很好,我们在下一小节在将.


相关文章: