Spring Boot Actuator

監控和管理 - Spring Boot Actuator

Spring Boot Actuator是spring boot的一個子集,提供的一些監控用的API。
官方文檔
使用
只需要添加一下依賴

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

提供了以下接口
具體接口請參考官方文檔。

Spring Boot 1.5 後,針對添加了權限控制, 如果需要放開權限,添加配置:management.security.enabled=false 默認是true。 參考文檔:http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html

Actuator通過Endpints來允許你和Spring Boot的app進行交互來監控和管理。

Mapping URI 描述 敏感
autoconfig 顯示一個auto-configuration的報告,該報告展示所有auto-configuration候選者及它們被應用或未被應用的原因 true
beans 顯示一個應用中所有Spring Beans的完整列表 true
configprops 顯示一個所有@ConfigurationProperties的整理列表 true
dump 執行一個線程轉儲 true
env 暴露來自Spring ConfigurableEnvironment的屬性 true
health 展示應用的健康信息(當使用一個未認證連接訪問時顯示一個簡單的’status’,使用認證連接訪問則顯示全部信息詳情) false
info 顯示任意的應用信息 false
metrics 展示當前應用的’指標’信息 true
mappings 顯示一個所有@RequestMapping路徑的整理列表 true
shutdown 允許應用以優雅的方式關閉(默認情況下不啓用) true
trace 顯示trace信息(默認爲最新的一些HTTP請求) true

If you are using Spring MVC, the following additional endpoints can also be used:
請參考官方文檔, 不在這裏贅述

發佈了40 篇原創文章 · 獲贊 16 · 訪問量 12萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章