赞
踩
Spring Boot特别适合团队构建各种可快速迭代的微服务,同时为了减少程序本身监控系统的开发量,Spring Boot 提供了 actuator 模块,可以很方便的对你的 Spring Boot 程序做监控。
Spring Boot 应用中加入监控很简单,只需要在pom.xml文件中加入以下依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
为了保证actuator接口的敏感性,在配置文件中,开放安全属性配置:
management.security.enabled=false
这样就能允许你查看 Spring Boot 进程的actuator信息了。
启动Spring Boot程序,在启动日志里看到可访问的actuator接口:

通过这些,我们可以实时的获取应用的各项监控指标。
actuator的接口分为原生接口和用户自定义接口。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。