1. 程式人生 > >spring boot 監控與管理(actuator)

spring boot 監控與管理(actuator)

依賴 操作 上下 -1 star oms blog start 技術分享

Spring POMs 中提供了一個特殊的依賴模塊,即spring-boot-starter-actuator,我們只需要在我們的POM中添加依賴即可

<!-- 監控 管理 -->
<dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

添加完該該依賴後,啟動spring應用會看到很多端點,截圖如下:

技術分享

紅框中的這些端點稱之為 原生端點,根據端點作用,可以分為3類

1. 應用配置類

  • /autoconfig 該端點用來獲取應用中自動化配置報告

技術分享

  • /beans 該端點用來獲取應用上下文創建的所有Bean類

技術分享

  • /configprops 該端點用來獲取應用中配置的屬性信息報告

技術分享

  • /env 該端點用來獲取應用所有可用的環境屬性報告

技術分享

  • /mappings 該端點用來返回Spring MVC 控制器映射關系報告

技術分享

  • /info 該端點用來返回一些應用自定義的信息

技術分享

2. 度量指標類

  • /metrics 該指標用來返回當前應用各類重要的度量指標

技術分享

  • /health 該端點可提供各種健康指標信息

技術分享

  • /dump 該端點用來暴露程序運行中線程信息

技術分享

  • /trace 該端點用來返回基本的HTTP跟蹤信息

技術分享

3. 操作控制類

spring boot 監控與管理(actuator)