1 actuator
1.1简介
spingboot自带监控功能Actuator,可以实现对程序内部运行情况监控,比如监控情况,Bean加载情况,配置属性。日志信息等。
1.2 创建项目
勾选
ops里的Spring boot Actuator选项
web里的spring Web
1.3导入依赖坐标
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
访问http://localhost:8080/actuator
实例:
使用http://json.cn的网站转换为json格式。
1.4 打开所有endpoint
# 开启健康检查的完整信息
management.endpoint.health.show-details=always
# 将所有的监控endpoint暴露出来
management.endpoints.web.exposure.include=*
2.可视化界面
2.1 创建项目
2.1.1 Server
勾选
ops里的(Server)选项
web里的spring Web
2.1.2 Client
勾选
ops里的client选项
web里的spring Web
2.2 配置
2.2.1 Server
在resources中设置端口
sever.port= 9000
启动类加注解(开启识别的作用)
@EnableAdminServer
2.2.2 Client
执行admin.server地址
spring.boot.admin.client.url=http://localhost:9000
打开所有endpoint
# 开启健康检查的完整信息
management.endpoint.health.show-details=always
# 将所有的监控endpoint暴露出来
management.endpoints.web.exposure.include=*
2.3 访问
http://localhost:9000
2.4 图形化界面结果
3.IJ自带的简捷的监控功能
项目运行后