springboot监控之监控管理

时间:2022-07-23
本文章向大家介绍springboot监控之监控管理,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

1、新建一个springboot项目,选中web、DevTools、Actuator

2、在application.properties里面配置

#actuator端口 
management.server.port=9001
#修改访问路径  2.0之前默认是/   2.0默认是 /actuator  可以通过这个属性值修改  
management.endpoints.web.base-path=/monitor
#开放所有页面节点  默认只开启了health、info两个节点
management.endpoints.web.exposure.include=*
#显示健康具体信息  默认不会显示详细信息  
management.endpoint.health.show-details=always

3、启动服务器,之后输入:localhost:9001/monitor/health

4、相关端点

5、测试

在appllication.properties同位置下新建git.properties:

git.branch=master
git.commit.id=123
git.commit.time=2019-02-10 12:12:56

启动服务器:并访问