Monitor OceanBase data using Prometheus

更新时间:
复制 MD 格式

This topic describes how to monitor an ApsaraDB for OceanBase database by deploying OBCloud Exporter and Prometheus.

Background information

OBCloud Exporter is a data processing tool provided by ApsaraDB for OceanBase. You can use this tool to authenticate and retrieve data from your OceanBase database. You can then use a local Prometheus tool to monitor the database.

The following sections describe two methods to deploy the tool: direct system deployment and Docker deployment.

Prerequisites

  1. A Java 8 or later runtime environment.

  2. The Docker deployment is now complete.

  3. The kubectl tools have been deployed.

Monitoring OceanBase cloud data with Prometheus

  1. Download OBCloud Exporter.

    Note

    OBCloud Exporter is not yet available for direct download. Contact technical support to obtain the package.

  2. Deploy OBCloud Exporter.

    1. Unzip the OBCloud Exporter installation package to the /opt/obcloud-exporter directory.

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

      The unzipped directory contains the following files:

      • Dockerfile: The Docker container build file.

      • muticloud_metric_config.yaml: The metric configuration file. You do not need to modify this file.

      • application.yaml: The data collection configuration file.

      • obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar: The OBCloud Exporter program.

      • readme.md: The project description.

    2. Edit the application.yaml configuration file.

      aliyun_monitor:
        ## Credentials
        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
        ## Instance information
        instances:
          instance_id: xxx
          tenant_id: xxx
          instance_type: cluster
          metrics: 
            - sql_all_rt
            - sql_delete_rt

      Parameter descriptions:

      Parameter name

      Required

      Description

      Sample value

      access_key_id

      Yes

      Authentication credentials. Go to My Account > AccessKey to obtain the credentials. You can request them on the platform. For more information, see Create an AccessKey.

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

      access_key_secret

      Yes

      Authentication credentials. Go to My Account > AccessKey to obtain the credentials. You can request them on the platform. For more information, see Create an AccessKey.

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

      region_id

      Yes

      The region. For more information, see Public cloud service regions.

      ap-southeast-1

      end_point

      Yes

      The endpoint. For more information, see Public cloud service regions.

      oceanbasepro.ap-southeast-1.aliyuncs.com

      metric_meta_auto_refresh

      No

      Specifies whether to periodically refresh metrics. The default value is false.

      false

      default_metric

      No

      Default metrics. If you do not configure the `instances` parameter to specify instances and metrics for collection, you can use `default_metric` to control the metrics collected for all instances under the account.

      - sql_all_rt

      instance_id

      No

      The cluster instance ID or tenant instance ID. You can enter multiple cluster or tenant instances separated by hyphens (-).

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

      tenant_id

      No

      • To query a specific tenant in a cluster, configure `tenant_id`. This parameter is optional when `instance_type` is set to `cluster`.

      • If the instance is a tenant instance, set both `instance_id` and `tenant_id` to the same instance ID and set `instance_type` to `tenant`.

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

      instance_type

      No

      The instance type:

      • `cluster`: Host-level metrics for the cluster. Monitoring data for all tenants in the cluster is automatically collected.

      • `tenant`: Database-level metrics for the tenant.

      Tenant

      metrics

      No

      The metrics to collect. By default, all metrics are collected. For a list of metrics, see the List of monitoring metrics section in this topic.

      Note

      Collecting too many metrics might slow down the collection speed. If necessary, split the task across multiple exporters.

      - sql_all_rt

  3. Run OBCloud Exporter using Java.

    1. Run the following command to start OBCloud Exporter with a specified configuration file.

      java -Dconfig=/xx/application.yaml -jar obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar --spring.config.location=/xx/application.properties
      • -Dconfig: (Optional) Specifies the monitoring configuration file to use for startup.

      • --spring.config.location: (Optional) The program integrates and enables the Spring Boot Actuator component by default on port 8082. You can customize the configuration and access the component using the configured address and port. The default configuration is:

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

        Common examples:

        # Start OBCloud Exporter with the default configuration
        java -jar obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar
        # Start OBCloud Exporter with a specified environment variable configuration file
        java -jar obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar --spring.config.location=/xx/application.properties
        # Start OBCloud Exporter with a specified monitoring configuration file
        java -Dconfig=/xx/application.yaml -jar obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar
        # Start OBCloud Exporter with both a monitoring configuration file and an environment variable configuration file
        java -Dconfig=/xx/application.yaml -jar obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar --spring.config.location=/xx/application.properties
    2. Verify the deployment in a browser. Access port 9400 of the corresponding IP address to confirm that monitoring data is being retrieved.

      Note

      Use the actual configured address and port.

  4. Download the Prometheus software. Find and download the required version of the Prometheus installation package from the official website. This example uses version 2.50.1 for Linux.

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

    1. Unzip and install the Prometheus software to the /opt/prometheus directory.

      mkdir -p /opt/prometheus
      tar -zxvf prometheus-2.50.1.linux-amd64.tar.gz -C /opt/prometheus --strip-components=1
    2. Move the prometheus.yml configuration file to the working directory and edit it as needed.

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

      Modify the following parameters:

      global:
        scrape_interval: 30s
        scrape_timeout: 20s
      
      scrape_configs:
        - job_name: "nodes"
          static_configs:
          - targets: ['localhost:9400']
    3. Create a Prometheus service file and its related data storage directory.

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

      Enter the following content and save the file.

      Note

      The User and Group parameters are optional. For instructions on how to set them, see the next step, Set the username and 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. (Optional) Set the username and user group. You can skip this step if you configured an existing user or user group in the previous step, or if you did not configure these parameters.

      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. Start the Prometheus service.

    # Reload the systemd configuration
    sudo systemctl daemon-reload
    
    # Start the Prometheus service
    sudo systemctl start prometheus
    
    # Enable auto-start on boot
    sudo systemctl enable prometheus
    
    # Check the service status
    sudo systemctl status prometheus
  7. Confirm that Prometheus has started successfully.

     sudo netstat -ntlp | grep 9090

Monitor ApsaraDB for OceanBase data by deploying Prometheus using Docker

  1. Download OBCloud Exporter.

    Note

    OBCloud Exporter is not yet available for direct download. Contact technical support to obtain the package.

  2. Deploy OBCloud Exporter.

    1. Unzip the OBCloud Exporter installation package to the /opt/obcloud-exporter directory.

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

      The unzipped directory contains the following files:

      • Dockerfile: The Docker container build file.

      • muticloud_metric_config.yaml: The metric configuration file. You do not need to modify this file.

      • application.yaml: The data collection configuration file.

      • obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar: The OBCloud Exporter program.

      • readme.md: The project description.

    2. Edit the application.yaml configuration file.

      aliyun_monitor:
        ## Credentials
        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
        ## Instance information
        instances:
          instance_id: xxx
          tenant_id: xxx
          instance_type: cluster
          metrics: 
            - sql_all_rt
            - sql_delete_rt

      Parameter descriptions:

      Parameter Name

      Required

      Description

      Example

      access_key_id

      Yes

      Authentication credentials. Go to My Account > AccessKey to obtain the credentials. You can request them on the platform. For more information, see Create an AccessKey.

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

      access_key_secret

      Yes

      Authentication credentials. Go to My Account > AccessKey to obtain the credentials. You can request them on the platform. For more information, see Create an AccessKey.

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

      region_id

      Yes

      The region. For more information, see Public cloud service regions.

      ap-southeast-1

      end_point

      Yes

      The endpoint. For more information, see Public cloud service regions.

      oceanbasepro.ap-southeast-1.aliyuncs.com

      metric_meta_auto_refresh

      No

      Specifies whether to periodically refresh metrics. The default value is false.

      false

      default_metric

      No

      Default metrics. If you do not configure the `instances` parameter to specify instances and metrics for collection, you can use `default_metric` to control the metrics collected for all instances under the account.

      - sql_all_rt

      instance_id

      No

      The cluster instance ID or tenant instance ID. You can enter multiple cluster or tenant instances separated by hyphens (-).

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

      tenant_id

      No

      • To query a specific tenant in a cluster, configure `tenant_id`. This parameter is optional when `instance_type` is set to `cluster`.

      • If the instance is a tenant instance, set both `instance_id` and `tenant_id` to the same instance ID and set `instance_type` to `tenant`.

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

      instance_type

      No

      The instance type:

      • `cluster`: Host-level metrics for the cluster. Monitoring data for all tenants in the cluster is automatically collected.

      • `tenant`: Database-level metrics for the tenant.

      tenant

      metrics

      No

      The metrics to collect. By default, all metrics are collected. For a list of metrics, see the List of monitoring metrics section in this topic.

      Note

      Collecting too many metrics might slow down the collection speed. If necessary, split the task across multiple exporters.

      - sql_all_rt

  3. Start OBCloud Exporter using Docker.

    1. In the /opt/obcloud-exporter directory, build the obcloud-exporter container.

      cd /opt/obcloud-exporter
      docker build -t obcloud-exporter:1.0 .
    2. Start the container directly or by mapping an external configuration file.

      1. Start the Docker container directly.

        docker run -itd -p9400:9400 --name obcloud-exporter obcloud-exporter:1.0
      2. Start the Docker container by mapping an external configuration file.

        docker run -itd -p9400:9400 -v /opt/obcloud-exporter/application.yaml:/app/application.yaml --name obcloud-exporter obcloud-exporter:1.0
  4. Verify the deployment in a browser. Access port 9400 of the corresponding IP address to confirm that monitoring data is being retrieved.

    Note

    Use the actual configured address and port.

  5. Create the Prometheus configuration file prometheus.yml.

    vi /usr/local/bin/prometheus.yml

    Edit the file content:

    global:
      scrape_interval: 30s
      evaluation_interval: 30s
    
    scrape_configs:
      - job_name: obcloud-exporter-test
        static_configs:
            # Local server and port
          - targets: ['obcloud-exporter:9400']
            labels:
              instance: obcloud-exporter
  6. Start the Prometheus service.

     docker run  -d \
       -p 9090:9090 \
       -v /usr/local/bin/prometheus.yml:/etc/prometheus/prometheus.yml  \
       --link obcloud-exporter  \
       --name prometheus \
       prom/prometheus
  7. Confirm that Prometheus has started successfully.

    sudo netstat -ntlp | grep 9090

Monitor OceanBase data by deploying Prometheus using Kubernetes

  1. Download OBCloud Exporter.

    Note

    OBCloud Exporter is not yet available for direct download. Contact technical support to obtain the package.

  2. Unzip the OBCloud Exporter installation package to the /opt/obcloud-exporter directory.

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

    The unzipped directory contains the following files:

    • Dockerfile: The Docker container build file.

    • muticloud_metric_config.yaml: The metric configuration file. You do not need to modify this file.

    • application.yaml: The data collection configuration file.

    • obcloud-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar: The OBCloud Exporter program.

    • readme.md: The project description.

  3. Package and upload the OBCloud Exporter image file.

    1. In the /opt/obcloud-exporter directory, build the obcloud-exporter container.

      cd /opt/obcloud-exporter
      docker build -t obcloud-exporter:1.0 .
    2. Log on to your cloud provider's image repository. The following example uses the Alibaba Cloud image repository. Modify the command as needed.

      docker login registry.cn-hangzhou.aliyuncs.com
      Username: ****@test.com
      Password:
    3. Change the image name to match the image repository name.

      docker tag obcloud-exporter:1.0 registry.cn-hangzhou.aliyuncs.com/obcloud-exporter:1.0
    4. Push the image to the image repository using `docker push`.

      docker push registry.cn-hangzhou.aliyuncs.com/obcloud-exporter:1.0
  4. Edit the deployment.yml configuration file locally.

    1. Create the deployment.yml configuration file.

      vi /opt/obcloud-exporter/deployment.yml
    2. Edit the configuration file:

      apiVersion: v1
      kind: ConfigMap
      metadata:
        name: exporter-config
        namespace: default
        labels: {}
        annotations: {}
      data:
        application.yaml: |
          ## Monitor name
          aliyun_monitor:
            ## Credentials
            credential:
              access_key_id: xxx
              access_key_secret: xx
              region_id: ap-southeast-1
              ## Endpoint
              end_point: xxx
            ## Specifies whether to periodically refresh metrics. Default value: false. (Currently only supported for Alibaba Cloud)
            metric_meta_auto_refresh: false
            ## Default metrics. If you do not configure instances for automatic retrieval, you can use default_metric to specify the metrics to collect.
            default_metric:
              - sql_all_rt
              - sql_delete_rt
            instances:
              - ## Instance ID
                instance_id: xxx
                ## Instance type: cluster (host-level metrics, including tenant metrics) or tenant (database-level metrics).
                instance_type: cluster
                ## Specified metrics to collect
                metrics:
                  - sql_all_rt
                  - sql_delete_rt
              - ## Instance ID
                instance_id: xxx
                ## To query a specific tenant in a cluster, configure tenant_id. This is optional when instance_type is cluster.
                ## If the instance is a tenant instance, set both instance_id and tenant_id to the same instance ID and set instance_type to tenant.
                tenant_id: xxx
                ## Instance type: cluster (host-level metrics, including tenant metrics) or tenant (database-level metrics).
                instance_type: tenant
                ## Specified metrics to collect
                metrics:
                  - sql_all_rt
                  - sql_delete_rt
          ## Monitor name
          muti_monitor:
            ## Credentials
            credential:
              access_key_id: xxx
              access_key_secret: xx
              ## Endpoint
              end_point: xxx
              ## Specifies whether to periodically refresh metrics. Default value: false. (Currently only supported for Alibaba Cloud)
              metric_meta_auto_refresh: false
            instances:
              - ## Instance ID
                instance_id: xxx
                ## To query a specific tenant in a cluster, configure tenant_id. This is optional when instance_type is cluster.
                ## If the instance is a tenant instance, set both instance_id and tenant_id to the same instance ID and set instance_type to tenant.
                tenant_id: xxx
                ## Instance type: cluster (host-level metrics, including tenant metrics) or tenant (database-level metrics).
                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"  # Set the time zone
                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

      Parameter descriptions:

      Parameter name

      Required

      Description

      Example value

      access_key_id

      Yes

      Authentication credentials. Go to My Account > AccessKey to obtain the credentials. You can request them on the platform. For more information, see Create an AccessKey.

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

      access_key_secret

      Yes

      Authentication credentials. Go to My Account > AccessKey to obtain the credentials. You can request them on the platform. For more information, see Create an AccessKey.

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

      region_id

      Yes

      The region. For more information, see Public cloud service regions.

      ap-southeast-1

      end_point

      Yes

      The endpoint. For more information, see Public cloud service regions.

      oceanbasepro.ap-southeast-1.aliyuncs.com

      metric_meta_auto_refresh

      No

      Specifies whether to periodically refresh metrics. The default value is false.

      false

      default_metric

      No

      Default metrics. If you do not configure the `instances` parameter to specify instances and metrics for collection, you can use `default_metric` to control the metrics collected for all instances under the account.

      - sql_all_rt

      instance_id

      No

      The cluster instance ID or tenant instance ID. You can enter multiple cluster or tenant instances separated by hyphens (-).

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

      tenant_id

      No

      • To query a specific tenant in a cluster, configure `tenant_id`. This parameter is optional when `instance_type` is set to `cluster`.

      • If the instance is a tenant instance, set both `instance_id` and `tenant_id` to the same instance ID and set `instance_type` to `tenant`.

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

      instance_type

      No

      The instance type:

      • `cluster`: Host-level metrics for the cluster. Monitoring data for all tenants in the cluster is automatically collected.

      • `tenant`: Database-level metrics for the tenant.

      tenant

      metrics

      No

      The metrics to collect. By default, all metrics are collected. For a list of metrics, see the List of monitoring metrics section in this topic.

      Note

      Collecting too many metrics might slow down the collection speed. If necessary, split the task across multiple exporters.

      - sql_all_rt

    3. After you save and update the deployment file, run the following command to apply the changes:

      kubectl apply -f /opt/obcloud-exporter/deployment.yml
  5. Create the Prometheus configuration file prometheus.yml.

    vi /opt/obcloud-exporter/prometheus.yml

    Edit the file content:

    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" # Specify the path for TSDB data
                - "--storage.tsdb.retention.time=15d"
                - "--web.enable-lifecycle" # Supports hot updates. Run localhost:30000/-/reload to apply changes immediately.
              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 # Exposes port 30000 on the node by default.
          targetPort: http
  6. Start the Prometheus service.

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

View database monitoring data in Prometheus

Access the Prometheus service at http://localhost:9090/targets in a browser to view the monitoring information.

Configuration examples

Note

Configure monitoring metrics as needed to ensure task efficiency. Avoid collecting too many metrics, because this can impact collection performance.

Dynamically retrieve instances under an account

  • Collect specified metrics

    ## Monitor name
    monitor:
      ## Credentials
      credential:
        access_key_id: xxx
        access_key_secret: xx
        region_id: ap-southeast-1
        ## Endpoint
        end_point: xxx
      metric_meta_auto_refresh: false
      ## Default metrics. If you do not configure instances for automatic retrieval, you can use default_metric to specify the metrics to collect.
      default_metric:
        - sql_all_rt
        - sql_delete_rt
  • Collect all metrics

    ## Monitor name
    monitor:
      ## Credentials
      credential:
        access_key_id: xxx
        access_key_secret: xx
        region_id: ap-southeast-1
        ## Endpoint
        end_point: xxx
      metric_meta_auto_refresh: false

Collect data from specified clusters under an account

  • Collect specified metrics. Select the `instance_type` as needed.

    ## Monitor name
    monitor:
      ## Credentials
      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
  • Collect all metrics. When `instance_type` is set to `cluster`, you can collect both host metrics for the cluster and database metrics for the tenants.

    ## Monitor name
    monitor:
      ## Credentials
      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
  • Collect all database metrics for a tenant. When `instance_type` is set to `tenant`, only the database metrics for the specified tenant are collected.

    ## Monitor name
    monitor:
      ## Credentials
      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

Collect data from multiple accounts

## Monitor name
aliyun:
  ## Credentials
  credential:
    access_key_id: xxx
    access_key_secret: xx
    region_id: ap-southeast-1
    end_point: xxx
  metric_meta_auto_refresh: false
muti:
  ## Credentials
  credential:
    access_key_id: xxx
    access_key_secret: xx
    end_point: xxx

List of monitoring metrics

Cluster host

Metric name

Description

Unit

load1

Average system load over the last 1 minute

-

load5

Average system load over the last 5 minutes

-

load15

Average system load over the last 15 minutes

-

cpu_percent

CPU usage

%

memory_buffers

Kernel buffer cache size

GB

memory_cached

Memory used by the cache

GB

memory_free

Available physical memory size

GB

memory_used

Physical memory usage

%

net_recv

Data volume received per second

MB

net_send

Data volume sent per second

MB

net_throughput

Network throughput rate

MB

ntp_offset_milliseconds

NTP clock offset

ms

ob_data_disk_percent

OceanBase data disk usage

%

ob_clog_disk_percent

OceanBase log disk usage

%

ob_data_disk_used_size

Disk usage

GB

ob_process_exists

OceanBase process liveness status

-

ob_clog_io

Average IOPS of the OceanBase log disk

times/s

ob_clog_io_read

Average read IOPS of the OceanBase log disk

times/s

ob_clog_io_write

Average write IOPS of the OceanBase log disk

times/s

ob_clog_io_read_time

Average time per read I/O operation on the OceanBase log disk

ms

ob_clog_io_time

Average time per I/O operation on the OceanBase log disk

ms

ob_clog_io_write_time

Average time per write I/O operation on the OceanBase log disk

ms

ob_clog_io_byte

Average I/O data volume per second on the OceanBase log disk

MB

ob_clog_io_read_byte

Read I/O data volume per second on the OceanBase log disk

MB

ob_clog_io_write_byte

Write I/O data volume per second on the OceanBase log disk

MB

ob_clog_io_util

I/O utilization of the OceanBase log disk

%

ob_data_io

Average IOPS of the OceanBase data disk

times/s

ob_data_io_read

Average read IOPS of the OceanBase data disk

times/s

ob_data_io_write

Average write IOPS of the OceanBase data disk

times/s

ob_data_io_read_time

Average time per read I/O operation on the OceanBase data disk

ms

ob_data_io_time

Average time per I/O operation on the OceanBase data disk

ms

ob_data_io_write_time

Average time per write I/O operation on the OceanBase data disk

ms

ob_data_io_byte

Average I/O data volume per second on the OceanBase data disk

MB

ob_data_io_read_byte

Read I/O data volume per second on the OceanBase data disk

MB

ob_data_io_write_byte

Write I/O data volume per second on the OceanBase data disk

MB

ob_data_io_util

I/O utilization of the OceanBase data disk

%

Tenant database

Performance and SQL

Metric name

Description

Unit

sql_all_count

Number of SQL statements processed per second

times/s

sql_delete_count

Number of DELETE statements processed per second

times/s

sql_insert_count

Number of INSERT statements processed per second

times/s

sql_other_count

Number of other statements, such as DDL, DCL, and DTL

times/s

sql_replace_count

Number of REPLACE statements processed per second

times/s

sql_select_count

Number of SELECT statements processed per second

times/s

sql_update_count

Number of UPDATE statements processed per second

times/s

sql_all_rt

Average processing time for SQL statements

ms

sql_delete_rt

Average processing time for DELETE statements

ms

sql_insert_rt

Average processing time for INSERT statements

ms

sql_other_rt

Average processing time for other statements, such as DDL, DCL, and DTL

ms

sql_replace_rt

Average processing time for REPLACE statements

ms

sql_select_rt

Average processing time for SELECT statements

ms

sql_update_rt

Average processing time for UPDATE statements

ms

p99_sql_all_rt

99th percentile average processing time for SQL statements

ms

active_session

Number of current active sessions

-

all_session

Number of current sessions

-

sql_distributed_count

Number of distributed execution plans processed per second

times/s

sql_local_count

Number of local executions processed per second

times/s

sql_remote_count

Number of remote execution plans processed per second

times/s

system_event_internal_total_waits

Number of internal wait events per second

times/s

system_event_io_total_waits

Number of I/O wait events per second

times/s

system_event_latch_total_waits

Number of latch wait events per second

times/s

system_event_other_total_waits

Number of other wait events per second

times/s

system_event_row_lock_wait_total_waits

Number of lock wait events per second

times/s

system_event_sync_rpc_total_waits

Number of synchronous RPC wait events per second

times/s

wait_event_count

Number of wait events per second

times/s

system_event_internal_time_waited

Average time for internal wait events

ms

system_event_io_time_waited

Average time for I/O wait events

ms

system_event_latch_time_waited

Average time for latch wait events

ms

system_event_other_time_waited

Average time for other wait events

ms

system_event_row_lock_wait_time_waited

Average time for lock wait events

ms

system_event_sync_rpc_time_waited

Average time for synchronous RPC wait events

ms

wait_event_rt

Average time for wait events

ms

request_dequeue_count

Number of requests dequeued from the processing queue

times/s

request_enqueue_count

Number of requests that entered the processing queue

times/s

request_queue_time

Wait time for SQL requests in the wait queue

μs

ob_cpu_percent

Tenant thread CPU usage

-

memstore_percent

MemStore usage percentage

-

rpc_packet_in_rt

Average time to receive RPC packets

μs

rpc_packet_out_rt

Average time to send RPC packets

μs

rpc_packet_in

RPC inbound packet throughput

byte

rpc_packet_out

RPC outbound packet throughput

byte

opened_cursors_count

Number of open cursors

-

ob_worktime

Database work time

s

ob_foreground_worktime

Database foreground work time

s

ob_background_worktime

Database background work time

s

ob_no_idle_waiting_time

Database non-idle wait time

s

ob_foreground_no_idle_waiting_time

Database foreground non-idle wait time

s

ob_background_no_idle_waiting_time

Database background non-idle wait time

s

slow_sql_count

Number of slow SQL queries

-

Transactions

Metric name

Description

Unit

transaction_commit_count

Number of transactions committed per second

times/s

transaction_count

TPS

times/s

transaction_rollback_count

Number of transactions rolled back per second

times/s

transaction_timeout_count

Number of timed-out transactions per second

times/s

transaction_commit_rt

Average transaction commit time

ms

transaction_rollback_rt

Average transaction rollback time

ms

transaction_rt

Average server-side processing time per transaction

ms

trans_commit_log_count

Number of transaction logs committed per second

times/s

clog_trans_log_total_size

Size of transaction logs committed per second

byte

memstore_write_lock_fail_count

Number of failed write lock waits

times/s

memstore_write_lock_succ_count

Number of successful write lock waits

times/s

memstore_write_lock_wait_time

Average write lock wait time

μs

transaction_multi_partition_count

Number of distributed transactions per second

times/s

transaction_single_partition_count

Number of normal transactions per second

times/s

trans_commit_log_sync_rt

Average network sync time per transaction log

ms

Storage and cache

Metric name

Description

Unit

active_memstore_used

Active MemStore size

MB

major_freeze_trigger

Merge trigger threshold

MB

memstore_limit

MemStore limit

MB

total_memstore_used

Total MemStore size

MB

io_read_count

Number of reads per second from SSStore

times/s

io_write_count

Number of writes per second to SSStore

times/s

io_read_rt

Average time per read from SSStore

ms

io_write_rt

Average time per write to SSStore

ms

io_read_size

Data volume read from SSStore per second

byte

io_write_size

Data volume written to SSStore per second

byte

block_cache_size

Block cache size

MB

bloom_filter_cache_size

Bloom filter cache size

MB

clog_cache_size

Clog cache size

MB

location_cache_size

Location cache size

MB

plan_cache_size

Execution plan cache size

MB

row_cache_size

Row cache size

MB

block_cache_hit_ratio

Block cache hit ratio

-

bloom_filter_cache_hit_ratio

Bloom filter cache hit ratio

-

clog_cache_hit_ratio

Clog cache hit ratio

-

location_cache_hit_ratio

Location cache hit ratio

-

plan_cache_hit_ratio

Execution plan cache hit ratio

-

row_cache_hit_ratio

Row cache hit ratio

-

block_cache_req_total

Number of block cache requests

-

bloom_filter_cache_req_total

Number of bloom filter cache requests

-

clog_cache_req_total

Number of Clog cache requests

-

location_cache_req_total

Number of location cache requests

-

row_cache_req_total

Number of row cache requests

-

ob_tenant_binlog_disk_used

Binlog disk usage

GB

ob_tenant_memory_percent

OceanBase tenant memory usage

%

ob_tenant_log_disk_total_bytes

Total log disk size

GB

ob_tenant_log_disk_used_bytes

Log disk usage

GB

ob_tenant_server_required_size

Data usage

GB

ob_tenant_server_data_size

Data volume

GB