Spring Boot 在 Start POMs中提供了一个特殊的依赖模块 spring-boot-start-actuator ,引入改模块能自动为Spring Boot构建应用提供一系列用于监控的端点。spring
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-start-actuator</artifactId> </dependency>
经过这些端点咱们能够实时获取应用的各项监控指标:spring-boot
好比访问 /health 端点,咱们能够获取以下信息;spa
{ "status":"UP", "diskSpace":{ "status":"UP", "total":"491270", "free":"383870", "threshold":"10485670" } }
使用Spring Cloud的各个组件后,他的返回会变得很是丰富,有助于咱们定制个性化的监控策略。线程
根据原生端点的做用,能够将原生端点分为如下三大类:code
应用配置类:例如:/autoconfig 获取应用自动化配置报告。blog
度量指标类:/metrics: 各种重要度量指标,好比内存信息,线程信息、垃圾回收信息。内存
操做控制类:/shutdown ,在配置文件中开启后,访问应用的/shutdown端点就能实现远程关闭该应用的操做。 自动化