全部產品
Search
文件中心

ApsaraDB for OceanBase:通過 Prometheus 監控 OceanBase 資料

更新時間:Jan 03, 2025

本文介紹如何通過部署 OBCloud Exporter 和 Prometheus 進行 OceanBase 雲資料庫的監控。

背景資訊

OBCloud Exporter 是OceanBase 提供的一款資料庫資料處理工具,可通過該工具完成 OceanBase 資料庫的鑒權和資料擷取。再結合本地 Prometheus 工具對資料庫進行相應的監控。

下文通過系統直接部署和通過 docker 部署兩種方式說明相應的工具使用方法。

前提條件

  1. 已部署 Java 8 及以上的運行環境。

  2. 已完成 Docker 部署。

  3. 已完成 kubectl 相關工具部署。

系統運行 Prometheus 監控 OceanBase 雲資料

  1. 下載 OBCloud Exporter。

    說明

    目前 OBCloud Exporter 暫未放開直接下載,可聯絡技術支援人員擷取。

  2. 部署 OBCloud Exporter。

    1. 解壓 OBCloud Exporter 安裝包,安裝目錄為 /opt/obcloud-exporter

      mkdir /opt/obcloud-exporter
      unzip Obcloud_Exporter.zip -d /opt/obcloud-exporter

      解壓後目錄包含如下檔案:

      • Dockerfile:Docker 容器構建檔案。

      • muticloud_metric_config.yaml:指標設定檔,此檔案預設不需要修改。

      • application.yaml:採集設定檔。

      • obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar:OBCloud Exporter 程式。

      • readme.md:專案說明。

    2. 編輯設定檔 application.yaml。

      aliyun_monitor:
        ## 身份憑據
        credential:
          access_key_id: xxx
          access_key_secret: xx
          region_id: ap-southeast-1
          end_point: xxx
        metric_meta_auto_refresh: false
        default_metric:
          - sql_all_rt
          - sql_delete_rt
        ## 執行個體資訊
        instances:
          instance_id: xxx
          tenant_id: xxx
          instance_type: cluster
          metrics: 
            - sql_all_rt
            - sql_delete_rt

      參數說明:

      參數名稱

      是否必填

      參數描述

      樣本值

      access_key_id

      鑒權資訊,訪問 我的帳號 > AccessKey 擷取,可在對應平台申請。具體操作,請參見,建立AccessKey

      ************

      access_key_secret

      鑒權資訊,訪問 我的帳號 > AccessKey 擷取,可在對應平台申請。具體操作,請參見,建立AccessKey

      ************

      region_id

      地區資訊請參見 公用雲端服務地區說明

      ap-southeast-1

      end_point

      終端地址請參見 公用雲端服務地區說明

      oceanbasepro.ap-southeast-1.aliyuncs.com

      metric_meta_auto_refresh

      是否定時重新整理 metric 指標,預設為 false。

      false

      default_metric

      預設指標,當沒有配置 instances 指定採集的執行個體和指標時,可通過 default_metric 控制帳號下所有執行個體採集指定的指標。

      - sql_all_rt

      instance_id

      叢集執行個體 ID 或租戶執行個體 ID。可包含多個叢集、租戶執行個體,通過短劃線(-)並列填入。

      ob************

      tenant_id

      • 查詢叢集下指定租戶,需配置 tenant_id, instance_type=cluster 時可以不配置。

      • 當執行個體為租戶執行個體時,需 instance_id 和 tenant_id 都配置相同的執行個體 ID,並且指定 instance_type 為 tenant。

      t************

      instance_type

      執行個體類型:

      • cluster:叢集主機維度監控指標,並且會自動採集叢集下所有租戶的監控資料。

      • tenant:租戶資料庫維度指標。

      tenant

      metrics

      指標資訊,預設為採集全部指標。具體指標清單,請參見本文 監控指標清單 章節。

      說明

      採集指標過多可能會影響採集速度,適當情況下拆分為多個 exporter。

      - sql_all_rt

  3. 通過 Java 運行 OBCloud Exporter。

    1. 可以通過如下命令,指定設定檔啟動 OBCloud Exporter。

      java -Dconfig=/xx/application.yaml -jar obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar --spring.config.location=/xx/application.properties
      • -Dconfig:(可選)指定監控設定檔啟動。

      • --spring.config.location:(可選)程式預設整合並開啟了 SpringBoot 的 actuator 組件,預設連接埠為 8082,實際使用中也可以自行配置,根據實際配置的地址連接埠進行訪問。預設配置為:

        server.port=-1
        management.server.port=8082
        management.endpoints.web.exposure.include=health,info
        management.endpoint.health.show-details=always

        常見樣本:

        # 預設配置啟動 OBCloud Exporter
        java -jar obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar
        # 指定環境組態變數啟動 OBCloud Exporter
        java -jar obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar --spring.config.location=/xx/application.properties
        # 指定監控設定檔啟動 OBCloud Exporter
        java -Dconfig=/xx/application.yaml -jar obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar
        # 同時指定監控設定檔和環境變數配置啟動 OBCloud Exporter
        java -Dconfig=/xx/application.yaml -jar obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar --spring.config.location=/xx/application.properties
    2. 通過瀏覽器驗證部署結果,訪問對應 IP 位址的 9400 連接埠,確認是否擷取到監控資料。

      說明

      實際使用中,根據實際配置的地址連接埠進行訪問。

  4. 下載 Prometheus 軟體,在官網找到所需版本的 Prometheus 安裝包,進行下載,如下以 2.50.1 的 Linux 版本為例。

    wget https://github.com/prometheus/prometheus/releases/download/v2.50.1/prometheus-2.50.1.linux-amd64.tar.gz
  5. 部署 Prometheus。

    1. 解壓並安裝 Prometheus 軟體,安裝目錄為 /opt/prometheus

      mkdir -p /opt/prometheus
      tar -zxvf prometheus-2.50.1.linux-amd64.tar.gz -C /opt/prometheus --strip-components=1
    2. 轉移設定檔 prometheus.yml 到工作目錄,並根據需要進行編輯。

      mv /opt/prometheus/prometheus.yml /usr/local/bin/
      vi /usr/local/bin/prometheus.yml

      修改如下參數:

      global:
        scrape_interval: 30s
        scrape_timeout: 20s
      
      scrape_configs:
        - job_name: "nodes"
          static_configs:
          - targets: ['localhost:9400']
    3. 建立 Prometheus 服務檔案和相關資料存放區目錄。

      mkdir /var/lib/prometheus/
      sudo vim /etc/systemd/system/Prometheus.service

      填寫如下內容並儲存。

      說明

      User(使用者)和 Group(使用者組)參數是可選的,設定方法請參考下一步驟 設定使用者名稱和使用者組

      [Unit]
      Description=Prometheus
      Wants=network-online.target
      After=network-online.target
      
      [Service]
      User=prometheus
      Group=prometheus
      Restart=on-failure
      ExecStart=/opt/prometheus/prometheus \
            --config.file /usr/local/bin/prometheus.yml \
            --storage.tsdb.path /var/lib/prometheus/
      
      [Install]
      WantedBy=multi-user.target
    4. (可選)設定使用者名稱和使用者組,上一步驟中配置已有的使用者/使用者組或者沒有配置,可忽略此步驟。

      sudo groupadd prometheus
      sudo useradd -r -g prometheus prometheus
      sudo chown -R prometheus:prometheus /opt/prometheus /var/lib/prometheus
      sudo chmod -R 755 /opt/prometheus /var/lib/prometheus
  6. 啟動 Prometheus 服務。

    # 載入新的 systemd 配置
    sudo systemctl daemon-reload
    
    # 啟動 Prometheus 服務
    sudo systemctl start prometheus
    
    # 設定開機啟動
    sudo systemctl enable prometheus
    
    # 檢查服務狀態
    sudo systemctl status prometheus
  7. 確認 Prometheus 是否啟動成功。

     sudo netstat -ntlp | grep 9090

通過 docker 部署 prometheus 監控 OceanBase 雲資料庫

  1. 下載 OBCloud Exporter。

    說明

    目前 OBCloud Exporter 暫未放開直接下載,可聯絡技術支援人員擷取。

  2. 部署 OBCloud Exporter。

    1. 解壓 OBCloud Exporter 安裝包,安裝目錄為 /opt/obcloud-exporter

      mkdir /opt/obcloud-exporter
      unzip Obcloud_Exporter.zip -d /opt/obcloud-exporter

      解壓後目錄包含如下檔案:

      • Dockerfile:Docker 容器構建檔案。

      • muticloud_metric_config.yaml:指標設定檔,此檔案預設不需要修改。

      • application.yaml:採集設定檔。

      • obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar:OBCloud Exporter 程式。

      • readme.md:專案說明。

    2. 編輯設定檔 application.yaml。

      aliyun_monitor:
        ## 身份憑據
        credential:
          access_key_id: xxx
          access_key_secret: xx
          region_id: ap-southeast-1
          end_point: xxx
        metric_meta_auto_refresh: false
        default_metric:
          - sql_all_rt
          - sql_delete_rt
        ## 執行個體資訊
        instances:
          instance_id: xxx
          tenant_id: xxx
          instance_type: cluster
          metrics: 
            - sql_all_rt
            - sql_delete_rt

      參數說明:

      參數名稱

      是否必填

      參數描述

      樣本值

      access_key_id

      鑒權資訊,訪問 我的帳號 > AccessKey 擷取,可在對應平台申請。具體操作,請參見,建立AccessKey

      ************

      access_key_secret

      鑒權資訊,訪問 我的帳號 > AccessKey 擷取,可在對應平台申請。具體操作,請參見,建立AccessKey

      ************

      region_id

      地區資訊請參見 公用雲端服務地區說明

      ap-southeast-1

      end_point

      終端地址請參見 公用雲端服務地區說明

      oceanbasepro.ap-southeast-1.aliyuncs.com

      metric_meta_auto_refresh

      是否定時重新整理 metric 指標,預設為 false。

      false

      default_metric

      預設指標,當沒有配置 instances 指定採集的執行個體和指標時,可通過 default_metric 控制帳號下所有執行個體採集指定的指標。

      - sql_all_rt

      instance_id

      叢集執行個體 ID 或租戶執行個體 ID。可包含多個叢集、租戶執行個體,通過短劃線(-)並列填入。

      ob************

      tenant_id

      • 查詢叢集下指定租戶,需配置 tenant_id, instance_type=cluster 時可以不配置。

      • 當執行個體為租戶執行個體時,需 instance_id 和 tenant_id 都配置相同的執行個體 ID,並且指定 instance_type 為 tenant。

      t************

      instance_type

      執行個體類型:

      • cluster:叢集主機維度監控指標,並且會自動採集叢集下所有租戶的監控資料。

      • tenant:租戶資料庫維度指標。

      tenant

      metrics

      指標資訊,預設為採集全部指標。具體指標清單,請參見本文 監控指標清單 章節。

      說明

      採集指標過多可能會影響採集速度,適當情況下拆分為多個 exporter。

      - sql_all_rt

  3. 通過 Docker 啟動 OBCloud Exporter。

    1. /opt/obcloud-exporter目錄下,構建 obcloud-exporter 容器。

      cd /opt/obcloud-exporter
      docker build -t obcloud-exporter:1.0 .
    2. 啟動容器或者映射外部設定檔啟動。

      1. 直接啟動 Docker 容器

        docker run -itd -p9400:9400 --name obcloud-exporter obcloud-exporter:1.0
      2. 通過映射外部設定檔啟動 Docker 容器。

        docker run -itd -p9400:9400 -v /opt/obcloud-exporter/application.yaml:/app/application.yaml --name obcloud-exporter obcloud-exporter:1.0
  4. 通過瀏覽器驗證部署結果,訪問對應 IP 位址的 9400 連接埠,確認是否擷取到監控資料。

    說明

    實際使用中,根據實際配置的地址連接埠進行訪問。

  5. 建立 Prometheus 設定檔 prometheus.yml。

    vi /usr/local/bin/prometheus.yml

    編輯設定檔內容:

    global:
      scrape_interval: 30s
      evaluation_interval: 30s
    
    scrape_configs:
      - job_name: obcloud-exporter-test
        static_configs:
            # 本機伺服器加連接埠
          - targets: ['obcloud-exporter:9400']
            labels:
              instance: obcloud-exporter
  6. 啟動 Prometheus 服務。

     docker run  -d \
       -p 9090:9090 \
       -v /usr/local/bin/prometheus.yml:/etc/prometheus/prometheus.yml  \
       --link obcloud-exporter  \
       --name prometheus \
       prom/prometheus
  7. 確認 Prometheus 是否啟動成功。

    sudo netstat -ntlp | grep 9090

通過 kubenetes 部署 Prometheus 監控 OceanBase 資料庫

  1. 下載 OBCloud Exporter。

    說明

    目前 OBCloud Exporter 暫未放開直接下載,可聯絡技術支援人員擷取。

  2. 解壓 OBCloud Exporter 安裝包,安裝目錄為 /opt/obcloud-exporter

    mkdir /opt/obcloud-exporter
    unzip Obcloud_Exporter.zip -d /opt/obcloud-exporter

    解壓後目錄包含如下檔案:

    • Dockerfile:Docker 容器構建檔案。

    • muticloud_metric_config.yaml:指標設定檔,此檔案預設不需要修改。

    • application.yaml:採集設定檔。

    • obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar:OBCloud Exporter 程式。

    • readme.md:專案說明。

  3. 打包並上傳 OBCloud Exporter 的鏡像檔案。

    1. /opt/obcloud-exporter目錄下,構建 obcloud-exporter 容器。

      cd /opt/obcloud-exporter
      docker build -t obcloud-exporter:1.0 .
    2. 登入雲廠商鏡像倉庫,下文以阿里雲鏡像庫為例,實際使用中根據個人需要修改。

      docker login registry.cn-hangzhou.aliyuncs.com
      Username: ****@test.com
      Password:
    3. 將鏡像名稱改成對應的鏡像倉庫名。

      docker tag obcloud-exporter:1.0 registry.cn-hangzhou.aliyuncs.com/obcloud-exporter:1.0
    4. docker push 上傳到鏡像倉庫。

      docker push registry.cn-hangzhou.aliyuncs.com/obcloud-exporter:1.0
  4. 在本地編輯設定檔 deployment.yml

    1. 建立設定檔 deployment.yml

      vi /opt/obcloud-exporter/deployment.yml
    2. 編輯設定檔:

      apiVersion: v1
      kind: ConfigMap
      metadata:
        name: exporter-config
        namespace: default
        labels: {}
        annotations: {}
      data:
        application.yaml: |
          ## 監控名稱
          aliyun_monitor:
            ## 身份憑據
            credential:
              access_key_id: xxx
              access_key_secret: xx
              region_id: ap-southeast-1
              ## 終端地址
              end_point: xxx
            ## 是否定時重新整理metric指標,預設為false(目前僅支援阿里雲)
            metric_meta_auto_refresh: false
            ## 預設指標,當沒有配置instances自動擷取執行個體時,可通過default_metric指定採集的指標
            default_metric:
              - sql_all_rt
              - sql_delete_rt
            instances:
              - ## 執行個體id
                instance_id: xxx
                ## 執行個體類型:cluster叢集主機維度監控指標(包含tenant維度), tenant租戶資料庫維度指標.
                instance_type: cluster
                ## 指定採集的指標
                metrics:
                  - sql_all_rt
                  - sql_delete_rt
              - ## 執行個體id
                instance_id: xxx
                ## 查詢叢集下指定租戶,需配置tenant_id, instance_type=cluster時可不配。
                ## 當執行個體為租戶執行個體時,需instance_id和tenant_id都配置相同的執行個體id,並且指定instance_type為tenant
                tenant_id: xxx
                ## 執行個體類型:cluster叢集主機維度監控指標(包含tenant維度), tenant租戶資料庫維度指標.
                instance_type: tenant
                ## 指定採集的指標
                metrics:
                  - sql_all_rt
                  - sql_delete_rt
          ## 監控名稱
          muti_monitor:
            ## 身份憑據
            credential:
              access_key_id: xxx
              access_key_secret: xx
              ## 終端地址
              end_point: xxx
              ## 是否定時重新整理metric指標,預設為false(目前僅支援阿里雲)
              metric_meta_auto_refresh: false
            instances:
              - ## 執行個體id
                instance_id: xxx
                ## 查詢叢集下指定租戶,需配置tenant_id, instance_type=cluster時可不配。
                ## 當執行個體為租戶執行個體時,需instance_id和tenant_id都配置相同的執行個體id,並且指定instance_type為tenant
                tenant_id: xxx
                ## 執行個體類型:cluster叢集主機維度監控指標(包含tenant維度), tenant租戶資料庫維度指標.
                instance_type: tenant
                metrics:
                  - sql_all_rt
                  - sql_delete_rt
      ---
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: obcloud-exporter
        namespace: default
      spec:
        replicas: 1
        selector:
          matchLabels:
            app: obcloud-exporter
        template:
          metadata:
            labels:
              app: obcloud-exporter
          spec:
            containers:
              - name: exporter
                image: registry.cn-hangzhou.aliyuncs.com/obcloud-exporter:1.0
                env:
                - name: TZ
                  value: "Asia/Shanghai"  # 設定時區
                command: ["java", "-jar", "/app/obcloud-exporter.jar"]
                imagePullPolicy: IfNotPresent
                livenessProbe:
                  httpGet:
                    path: /actuator/health
                    port: 8082
                  initialDelaySeconds: 15
                  periodSeconds: 20
                readinessProbe:
                  httpGet:
                    path: /
                    port: 9400
                  initialDelaySeconds: 5
                  periodSeconds: 10
                volumeMounts:
                  - name: config-volume
                    mountPath: /app/application.yaml
                    subPath: application.yaml
            volumes:
              - name: config-volume
                configMap:
                  name: exporter-config
      ---
      apiVersion: v1
      kind: Service
      metadata:
        name: exporter-service
        namespace: default
      spec:
        selector:
          app: obcloud-exporter
        ports:
          - protocol: TCP
            port: 9400
            targetPort: 9400
        type: ClusterIP

      參數說明:

      參數名稱

      是否必填

      參數描述

      樣本值

      access_key_id

      鑒權資訊,訪問 我的帳號 > AccessKey 擷取,可在對應平台申請。具體操作,請參見,建立AccessKey

      ************

      access_key_secret

      鑒權資訊,訪問 我的帳號 > AccessKey 擷取,可在對應平台申請。具體操作,請參見,建立AccessKey

      ************

      region_id

      地區資訊請參見 公用雲端服務地區說明

      ap-southeast-1

      end_point

      終端地址請參見 公用雲端服務地區說明

      oceanbasepro.ap-southeast-1.aliyuncs.com

      metric_meta_auto_refresh

      是否定時重新整理 metric 指標,預設為 false。

      false

      default_metric

      預設指標,當沒有配置 instances 指定採集的執行個體和指標時,可通過 default_metric 控制帳號下所有執行個體採集指定的指標。

      - sql_all_rt

      instance_id

      叢集執行個體 ID 或租戶執行個體 ID。可包含多個叢集、租戶執行個體,通過短劃線(-)並列填入。

      ob************

      tenant_id

      • 查詢叢集下指定租戶,需配置 tenant_id, instance_type=cluster 時可以不配置。

      • 當執行個體為租戶執行個體時,需 instance_id 和 tenant_id 都配置相同的執行個體 ID,並且指定 instance_type 為 tenant。

      t************

      instance_type

      執行個體類型:

      • cluster:叢集主機維度監控指標,並且會自動採集叢集下所有租戶的監控資料。

      • tenant:租戶資料庫維度指標。

      tenant

      metrics

      指標資訊,預設為採集全部指標。具體指標清單,請參見本文 監控指標清單 章節。

      說明

      採集指標過多可能會影響採集速度,適當情況下拆分為多個 exporter。

      - sql_all_rt

    3. 儲存並更新部署檔案後,運行以下命令來應用修改:

      kubectl apply -f /opt/obcloud-exporter/deployment.yml
  5. 建立 Prometheus 設定檔 prometheus.yml。

    vi /opt/obcloud-exporter/prometheus.yml

    編輯設定檔內容:

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: prometheus-config
      namespace: default
    data:
      prometheus.yaml: |
        global:
          scrape_interval: 60s
          scrape_timeout: 55s
        scrape_configs:
        - job_name: "exporter"
          static_configs:
          - targets: ['exporter-service:9400']
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: prometheus
      namespace: default
    spec:
      selector:
        matchLabels:
          app: prometheus
      template:
        metadata:
          labels:
            app: prometheus
        spec:
          volumes:
            - name: config-volume
              configMap:
                name: prometheus-config
          containers:
            - image: prom/prometheus:v2.35.0
              name: prometheus
              args:
                - "--config.file=/etc/prometheus/prometheus.yaml"
                - "--storage.tsdb.path=/prometheus" # 指定tsdb資料路徑
                - "--storage.tsdb.retention.time=15d"
                - "--web.enable-lifecycle" # 支援熱更新,直接執行localhost:30000/-/reload立即生效
              ports:
                - containerPort: 9090
                  name: http
              securityContext:
                runAsUser: 0
              volumeMounts:
                - mountPath: "/etc/prometheus"
                  name: config-volume
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: prometheus
      namespace: default
    spec:
      selector:
        app: prometheus
      type: NodePort
      ports:
        - name: web
          port: 9090
          nodePort: 30000 #預設開啟節點的 30000 連接埠
          targetPort: http
  6. 啟動 Prometheus 服務。

    kubectl apply -f /opt/obcloud-exporter/prometheus.yml

通過 Prometheus 查看資料庫監控

通過瀏覽器訪問 Prometheus 服務地址:http://localhost:9090/targets,查看相應的監控資訊。lQLPJxcJ683eZ_HNAmbNDuKwDdAnFkHqjxkF4KMzI2DYAA_3810_614

配置樣本

說明

建議根據實際需求配置監控指標,以確保任務執行效率,避免過多指標影響採集效率。

動態擷取帳號下執行個體

  • 採集指定指標

    ## 監控名稱
    monitor:
      ## 身份憑據
      credential:
        access_key_id: xxx
        access_key_secret: xx
        region_id: ap-southeast-1
        ## 終端地址
        end_point: xxx
      metric_meta_auto_refresh: false
      ## 預設指標,當沒有配置instances自動擷取執行個體時,可通過 default_metric 指定採集的指標
      default_metric:
        - sql_all_rt
        - sql_delete_rt
  • 採集所有指標

    ## 監控名稱
    monitor:
      ## 身份憑據
      credential:
        access_key_id: xxx
        access_key_secret: xx
        region_id: ap-southeast-1
        ## 終端地址
        end_point: xxx
      metric_meta_auto_refresh: false

採集帳號下指定的叢集

  • 採集指定的指標,可根據實際情況選擇 instance_type。

    ## 監控名稱
    monitor:
      ## 身份憑據
      credential:
        access_key_id: xxx
        access_key_secret: xx
        region_id: ap-southeast-1
        end_point: xxx
      metric_meta_auto_refresh: false
      instances:
          instance_id: xxx
          tenant_id: xxx
          instance_type: tenant
          metrics: 
            - sql_all_rt
            - sql_delete_rt
  • 採集所有指標,instance_type 值設定為 cluster 時,可同時採集叢集的主機指標和租戶資料庫指標。

    ## 監控名稱
    monitor:
      ## 身份憑據
      credential:
        access_key_id: xxx
        access_key_secret: xx
        region_id: ap-southeast-1
        end_point: xxx
      metric_meta_auto_refresh: false
      instances:
          instance_id: xxx
          instance_type: cluster
  • 採集租戶資料庫所有指標,instance_type 值設定為 tenant 時,只採集指定租戶的租戶資料庫指標。

    ## 監控名稱
    monitor:
      ## 身份憑據
      credential:
        access_key_id: xxx
        access_key_secret: xx
        region_id: ap-southeast-1
        end_point: xxx
      metric_meta_auto_refresh: false
      instances:
          instance_id: xxx
          tenant_id: xx
          instance_type: tenant

採集多個帳號

## 監控名稱
aliyun:
  ## 身份憑據
  credential:
    access_key_id: xxx
    access_key_secret: xx
    region_id: ap-southeast-1
    end_point: xxx
  metric_meta_auto_refresh: false
muti:
  ## 身份憑據
  credential:
    access_key_id: xxx
    access_key_secret: xx
    end_point: xxx

監控指標清單

叢集主機

採集項名稱

採集項說明

採集項單位

load1

過去1分鐘系統平均負載

-

load5

過去5分鐘系統平均負載

-

load15

過去15分鐘系統平均負載

-

cpu_percent

CPU 使用率

%

memory_buffers

核心 Buffer Cache 大小

GB

memory_cached

緩衝使用的記憶體

GB

memory_free

可用實體記憶體大小

GB

memory_used

使用實體記憶體大小

%

net_recv

每秒接收資料量

MB

net_send

每秒發送資料量

MB

net_throughput

網路吞吐率

MB

ntp_offset_milliseconds

ntp時鐘位移

ms

ob_data_disk_percent

OB 資料盤使用率

%

ob_clog_disk_percent

OB 日誌盤使用率

%

ob_data_disk_used_size

磁碟使用量

GB

ob_process_exists

OB進程存活狀態

-

ob_clog_io

OB 日誌盤平均每秒 IO 次數

times/s

ob_clog_io_read

OB 日誌盤平均每秒讀 IO 次數

times/s

ob_clog_io_write

OB 日誌盤平均每秒寫IO 次數

times/s

ob_clog_io_read_time

OB 日誌盤平均每次讀 IO 耗時

ms

ob_clog_io_time

OB 日誌盤平均每次 IO 耗時

ms

ob_clog_io_write_time

OB 日誌盤平均每次寫 IO 耗時

ms

ob_clog_io_byte

OB 日誌盤平均每秒 IO 資料量

MB

ob_clog_io_read_byte

OB 日誌盤每秒讀 IO 資料量

MB

ob_clog_io_write_byte

OB 日誌盤每秒寫 IO 資料量

MB

ob_clog_io_util

OB 日誌盤 IO 使用率

%

ob_data_io

OB 資料盤平均每秒 IO 次數

times/s

ob_data_io_read

OB 資料盤平均每秒讀 IO 次數

times/s

ob_data_io_write

OB 資料盤平均每秒寫 IO 次數

times/s

ob_data_io_read_time

OB 資料盤平均每次讀 IO 耗時

ms

ob_data_io_time

OB 資料盤平均每次 IO 耗時

ms

ob_data_io_write_time

OB 資料盤平均每次寫 IO 耗時

ms

ob_data_io_byte

OB 資料盤平均每秒 IO 資料量

MB

ob_data_io_read_byte

OB 資料盤每秒讀 IO 資料量

MB

ob_data_io_write_byte

OB 資料盤每秒寫 IO 資料量

MB

ob_data_io_util

OB 資料盤 IO 使用率

%

租戶資料庫

效能與 SQL

採集項名稱

採集項說明

採集項單位

sql_all_count

每秒處理 SQL 陳述式數

times/s

sql_delete_count

每秒處理 Delete 語句數

times/s

sql_insert_count

每秒處理 Insert 語句數

times/s

sql_other_count

DDL, DCL, DTL 等其他語句數

times/s

sql_replace_count

每秒處理 Replace 語句數

times/s

sql_select_count

每秒處理 Select 語句數

times/s

sql_update_count

每秒處理 Update 語句數

times/s

sql_all_rt

SQL 陳述式平均處理耗時

ms

sql_delete_rt

Delete 語句平均處理耗時

ms

sql_insert_rt

Insert 語句平均處理耗時

ms

sql_other_rt

DDL, DCL, DTL 等其他語句平均處理耗時

ms

sql_replace_rt

Replace 語句平均處理耗時

ms

sql_select_rt

Select 語句平均處理耗時

ms

sql_update_rt

Update 語句平均處理耗時

ms

p99_sql_all_rt

99 分位 SQL 陳述式平均處理耗時

ms

active_session

當前活躍會話數

-

all_session

當前會話數

-

sql_distributed_count

每秒處理分布式執行計畫數

times/s

sql_local_count

每秒處理本地執行數

times/s

sql_remote_count

每秒處理遠程執行計畫數

times/s

system_event_internal_total_waits

每秒內部等待事件次數

times/s

system_event_io_total_waits

每秒 IO 等待事件次數

times/s

system_event_latch_total_waits

每秒 latch 等待事件次數

times/s

system_event_other_total_waits

每秒其他等待事件次數

times/s

system_event_row_lock_wait_total_waits

每秒鎖等待事件次數

times/s

system_event_sync_rpc_total_waits

每秒同步 RPC 等待事件次數

times/s

wait_event_count

每秒等待事件次數

times/s

system_event_internal_time_waited

內部等待事件平均耗時

ms

system_event_io_time_waited

IO 等待事件平均耗時

ms

system_event_latch_time_waited

latch 等待事件平均耗時

ms

system_event_other_time_waited

其他等待事件平均耗時

ms

system_event_row_lock_wait_time_waited

鎖等待時間平均耗時

ms

system_event_sync_rpc_time_waited

同步 RPC 等待事件平均耗時

ms

wait_event_rt

等待事件平均耗時

ms

request_dequeue_count

從處理隊列出隊的請求數量

times/s

request_enqueue_count

進入處理隊列的請求數量

times/s

request_queue_time

SQL 請求在等待隊列中的等待耗時

μs

ob_cpu_percent

租戶線程CPU使用率

-

memstore_percent

MEMStore使用百分比

-

rpc_packet_in_rt

Rpc 收包平均耗時

μs

rpc_packet_out_rt

Rpc 發包平均耗時

μs

rpc_packet_in

Rpc 收包輸送量

byte

rpc_packet_out

Rpc 發包輸送量

byte

opened_cursors_count

開啟的遊標數

-

ob_worktime

資料庫工作時間

s

ob_foreground_worktime

資料庫前台工作時間

s

ob_background_worktime

資料庫後台工作時間

s

ob_no_idle_waiting_time

資料庫非空閑等待時間

s

ob_foreground_no_idle_waiting_time

資料庫前台非空閑等待時間

s

ob_background_no_idle_waiting_time

資料庫後台非空閑等待時間

s

slow_sql_count

慢sql數量

-

事務

採集項名稱

採集項說明

採集項單位

transaction_commit_count

每秒提交事務數

times/s

transaction_count

TPS

times/s

transaction_rollback_count

每秒復原事務數

times/s

transaction_timeout_count

每秒逾時事務數

times/s

transaction_commit_rt

事務平均提交耗時

ms

transaction_rollback_rt

事務平均復原耗時

ms

transaction_rt

服務端每個事務平均處理時間

ms

trans_commit_log_count

每秒提交的交易記錄數

times/s

clog_trans_log_total_size

每秒提交的交易記錄大小

byte

memstore_write_lock_fail_count

寫鎖等待失敗次數

times/s

memstore_write_lock_succ_count

寫鎖等待成功次數

times/s

memstore_write_lock_wait_time

寫鎖平均等待耗時

μs

transaction_multi_partition_count

每秒分散式交易數

times/s

transaction_single_partition_count

每秒普通事務數

times/s

trans_commit_log_sync_rt

每次交易記錄網路同步平均耗時

ms

儲存與緩衝

採集項名稱

採集項說明

採集項單位

active_memstore_used

活躍 MEMStore 大小

MB

major_freeze_trigger

觸發合并閾值

MB

memstore_limit

MEMStore的limit

MB

total_memstore_used

MEMStore 總大小

MB

io_read_count

SSStore 每秒讀次數

times/s

io_write_count

SSStore 每秒寫次

times/s

io_read_rt

SSStore 每次讀取平均耗時

ms

io_write_rt

SSStore 每次寫入平均耗時

ms

io_read_size

SSStore 每秒讀取資料量

byte

io_write_size

SSStore 每秒寫入資料量

byte

block_cache_size

塊緩衝大小

MB

bloom_filter_cache_size

bloom filter 緩衝大小

MB

clog_cache_size

Clog 緩衝大小

MB

location_cache_size

location 緩衝大小

MB

plan_cache_size

執行計畫緩衝大小

MB

row_cache_size

行緩衝大小

MB

block_cache_hit_ratio

塊快取命中率

-

bloom_filter_cache_hit_ratio

bloom filter 快取命中率

-

clog_cache_hit_ratio

Clog 快取命中率

-

location_cache_hit_ratio

location 快取命中率

-

plan_cache_hit_ratio

執行計畫快取命中率

-

row_cache_hit_ratio

行快取命中率

-

block_cache_req_total

塊緩衝請求次數

-

bloom_filter_cache_req_total

bloom filter 緩衝請求次數

-

clog_cache_req_total

Clog 緩衝請求次數

-

location_cache_req_total

location 緩衝請求次數

-

row_cache_req_total

行緩衝請求次數

-

ob_tenant_binlog_disk_used

binlog日誌磁碟使用量

GB

ob_tenant_memory_percent

OB租戶記憶體使用量率

%

ob_tenant_log_disk_total_bytes

日誌盤總量

GB

ob_tenant_log_disk_used_bytes

日誌盤使用量

GB

ob_tenant_server_required_size

資料佔用量

GB

ob_tenant_server_data_size

資料量

GB