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端點就能實現遠程關閉該應用的操做。 自動化