<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          SpringBoot之a(chǎn)ctuator度量指標(biāo)監(jiān)控與健康檢查

          共 1454字,需瀏覽 3分鐘

           ·

          2020-09-01 10:51

          點擊上方藍色字體,選擇“標(biāo)星公眾號”

          優(yōu)質(zhì)文章,第一時間送達

          ? 作者?|??lawrence林?

          來源 |? urlify.cn/iYVjqe ??

          66套java從入門到精通實戰(zhàn)課程分享?

          添加actuator依賴

          <dependency>
          ???<groupId>org.springframework.bootgroupId>

          ???<artifactId>spring-boot-starter-actuatorartifactId>
          dependency>

          #/默認值訪問health,info端點,用*可以包含全部端點
          management.endpoints.web.exposure.include= *
          #Web端點的基本路徑,默認為/actuator
          management.endpoints.web.base-path=/actuator

          #
          排除env,beans的端點訪問
          #management.endpoints.web.exposure.exclude=env,beans
          #指定開啟bean,env端點進行訪問:
          #management.endpoints.web.exposure.include=beans,env


          通過:

          url:localhost:8080/actuator

          進行訪問

          使用可是化監(jiān)控應(yīng)用Spring Boot Admin(不是官方提供的)

          創(chuàng)建一個新項目用于搭建服務(wù)端

          搭建服務(wù)器端


          <dependency>
          ???<groupId>de.codecentricgroupId>
          ???<artifactId>spring-boot-admin-starter-serverartifactId>
          ???<version>2.2.2version>
          dependency>

          添加配置

          server.port=9090

          修改啟動類

          @SpringBootApplication
          @EnableAdminServer//開啟Spring Boot Admin 服務(wù)端
          public class SpringbootactuatorserverApplication {

          ???public?static?void?main(String[] args) {
          ??????SpringApplication.run(SpringbootactuatorserverApplication.class, args);
          ???}
          }

          搭建客戶端

          • 修改POM文件

          • 修改配置文件

          在原來的actuator項目中添加依賴,用于搭建客戶端


          <dependency>
          ????<groupId>de.codecentricgroupId>
          ????<artifactId>spring-boot-admin-starter-clientartifactId>
          ????<version>2.2.2version>
          dependency>

          修改配置文件

          #/默認值訪問health,info端點,用*可以包含全部端點
          management.endpoints.web.exposure.include= *
          #Web端點的基本路徑,默認為/actuator
          management.endpoints.web.base-path=/actuator

          #
          指定服務(wù)端的訪問地址
          spring.boot.admin.client.url=http://localhost:9090

          同時啟動客戶端和服務(wù)端
          通過URL:?http://localhost:9090/進行訪問





          ??? ?



          感謝點贊支持下哈?

          瀏覽 123
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  亚洲俺也去 | 人人看人人撸 | 亚洲无码电影一 | 香蕉久久地址一 | 麻豆成人91精品二区三区 |