跳转至

阿里云 OceanBase

采集阿里云 OceanBase 指标、慢查询日志数据

配置

安装 Func

推荐开通 观测云集成 - 扩展 - 托管版 Func

如果自行部署 Func 参考自行部署 Func

安装脚本

提示:请提前准备好符合要求的阿里云 AK(简单起见,可直接授予全局只读权限ReadOnlyAccess

指标

  1. 登陆 Func 控制台,点击【脚本市场】,进入观测云脚本市场,搜索:integration_alibabacloud_oceanbase_metric

  2. 点击【安装】后,输入相应的参数:阿里云 AK ID 、AK Secret 及账户名。

  3. 点击【部署启动脚本】,系统会自动创建 Startup 脚本集,并自动配置相应的启动脚本。

  4. 开启后可以在「管理 / 自动触发配置」里看到对应的自动触发配置。点击【执行】,即可立即执行一次,无需等待定期时间。稍等片刻,可以查看执行任务记录以及对应日志。

慢查询日志

  1. 登陆 Func 控制台,点击【脚本市场】,进入观测云脚本市场,搜索:integration_alibabacloud_oceanbase_slowlog

  2. 点击【安装】后,输入相应的参数:阿里云 AK ID 、AK Secret 及账户名。

  3. 点击【部署启动脚本】,系统会自动创建 Startup 脚本集,并自动配置相应的启动脚本。

  4. 开启后可以在「管理 / 自动触发配置」里看到对应的自动触发配置。点击【执行】,即可立即执行一次,无需等待定期时间。稍等片刻,可以查看执行任务记录以及对应日志。

验证

  1. 在「管理 / 自动触发配置」确认对应的任务是否已存在对应的自动触发配置,同时可以查看对应任务记录及日志检查是否有异常
  2. 在观测云,「基础设施 / 自定义」中查看是否存在资产信息
  3. 在观测云,「指标」查看是否有对应监控数据

指标

阿里云 OceanBase 指标在 aliyun_oceanbase_metric 指标集下,以下是指标详情

指标名 描述 单位
active_memstore_used 当前活跃 MemStore 已使用内存 字节
active_session 活跃会话数
all_session 总会话数
block_cache_hit_ratio Block Cache 命中率 %
block_cache_req_total Block Cache 总请求数
block_cache_size Block Cache 大小 字节
bloom_filter_cache_hit_ratio Bloom Filter Cache 命中率 %
bloom_filter_cache_req_total Bloom Filter Cache 总请求数
bloom_filter_cache_size Bloom Filter Cache 大小 字节
client_connections 客户端连接数
clog_cache_hit_ratio Clog Cache 命中率 %
clog_cache_req_total Clog Cache 总请求数
clog_cache_size Clog Cache 大小 字节
clog_trans_log_total_size 事务日志总大小 字节
cpu_percent CPU 使用率 %
io_byte IO 总字节数 字节
io_count IO 总次数
io_read 读 IO 总字节数 字节
io_read_byte 读 IO 字节数 字节
io_read_count 读 IO 次数
io_read_rt 读 IO 平均响应时间 毫秒
io_read_size 读 IO 平均大小 字节
io_rt IO 平均响应时间 毫秒
io_size IO 平均大小 字节
io_write 写 IO 总字节数 字节
io_write_byte 写 IO 字节数 字节
io_write_count 写 IO 次数
io_write_rt 写 IO 平均响应时间 毫秒
io_write_size 写 IO 平均大小 字节
load_1 1 分钟系统负载
location_cache_hit_ratio Location Cache 命中率 %
location_cache_req_total Location Cache 总请求数
major_freeze_trigger 触发 Major Freeze 次数
memory_buffers 缓冲区内存 字节
memory_free 空闲内存 字节
memory_percent 内存使用率 %
memstore_limit MemStore 上限 字节
memstore_percent MemStore 使用率 %
memstore_write_lock_fail_count MemStore 写锁失败次数
memstore_write_lock_succ_count MemStore 写锁成功次数
net_recv 网络接收字节数 字节
net_send 网络发送字节数 字节
net_throughput 网络吞吐量 字节/秒
ob_background_waitevent_count 后台等待事件数
ob_clog_disk_percent Clog 磁盘使用率 %
ob_clog_io Clog IO 次数
ob_clog_io_byte Clog IO 字节数 字节
ob_clog_io_time Clog IO 时间 毫秒
ob_clog_io_util Clog IO 利用率 %
ob_clog_ls_max_replayed_scn 最大回放 SCN
ob_cpu_percent OB CPU 使用率 %
ob_data_disk_percent 数据磁盘使用率 %
ob_data_disk_used_size 数据磁盘已用大小 字节
ob_data_io 数据 IO 次数
ob_data_io_byte 数据 IO 字节数 字节
ob_data_io_time 数据 IO 时间 毫秒
ob_data_io_util 数据 IO 利用率 %
ob_data_required_size 数据需求大小 字节
ob_host_real_time_iops 实时 IOPS 次/秒
ob_host_real_time_throughput 实时吞吐量 字节/秒
ob_no_idle_waiting_time 非空闲等待时间 毫秒
ob_process_exists OB 进程是否存在 布尔
ob_sql_event SQL 事件数
ob_sql_event_in_parse SQL 解析中事件数
ob_sql_event_in_pl_parse PL 解析中事件数
ob_sql_event_in_plan_cache Plan Cache 中事件数
ob_sql_event_in_px_execution 并行执行中事件数
ob_sql_event_in_sequence_load 序列加载中事件数
ob_sql_event_in_sql_execution SQL 执行中事件数
ob_sql_event_in_sql_optimize SQL 优化中事件数
ob_tenant_data_size 租户数据大小 字节
ob_tenant_disk_used_percentage 租户磁盘使用率 %
ob_tenant_log_disk_total_bytes 租户日志磁盘总大小 字节
ob_tenant_log_disk_used_bytes 租户日志磁盘已用大小 字节
ob_tenant_memory_percent 租户内存使用率 %
ob_tenant_server_data_size 租户在 Server 上的数据大小 字节
ob_tenant_server_required_size 租户在 Server 上的需求大小 字节
ob_waitevent_count 等待事件数
ob_worktime 工作时间 毫秒
opened_cursors_count 打开的游标数
plan_cache_hit_ratio Plan Cache 命中率 %
plan_cache_size Plan Cache 大小 字节
qps 每秒查询数 次/秒
qps_rt 查询平均响应时间 毫秒
request_dequeue_count 请求出队数
request_enqueue_count 请求入队数
request_queue_time 请求排队时间 毫秒
row_cache_hit_ratio Row Cache 命中率 %
row_cache_req_total Row Cache 总请求数
row_cache_size Row Cache 大小 字节
rpc_packet_in 入 RPC 包数
rpc_packet_in_rt 入 RPC 包平均响应时间 毫秒
rpc_packet_out 出 RPC 包数
rpc_packet_out_rt 出 RPC 包平均响应时间 毫秒
server_connections Server 连接数
slow_sql_count 慢 SQL 数
sql_all_count 总 SQL 数
sql_all_rt SQL 平均响应时间 毫秒
sql_all_rt_p_90 SQL 90分位响应时间 毫秒
sql_all_rt_p_95 SQL 95分位响应时间 毫秒
sql_all_rt_p_99 SQL 99分位响应时间 毫秒
sql_delete_count DELETE 语句数
sql_distributed_count 分布式 SQL 数
sql_insert_count INSERT 语句数
sql_insert_rt INSERT 平均响应时间 毫秒
sql_insert_rt_p_90 INSERT 90分位响应时间 毫秒
sql_insert_rt_p_95 INSERT 95分位响应时间 毫秒
sql_insert_rt_p_99 INSERT 99分位响应时间 毫秒
sql_local_count 本地 SQL 数
sql_other_count 其他 SQL 数
sql_other_rt 其他 SQL 平均响应时间 毫秒
sql_other_rt_p_90 其他 SQL 90分位响应时间 毫秒
sql_other_rt_p_95 其他 SQL 95分位响应时间 毫秒
sql_other_rt_p_99 其他 SQL 99分位响应时间 毫秒
sql_remote_count 远程 SQL 数
sql_replace_count REPLACE 语句数
sql_select_count SELECT 语句数
sql_select_rt SELECT 平均响应时间 毫秒
sql_select_rt_p_90 SELECT 90分位响应时间 毫秒
sql_select_rt_p_95 SELECT 95分位响应时间 毫秒
sql_select_rt_p_99 SELECT 99分位响应时间 毫秒
sql_update_count UPDATE 语句数
sql_update_rt UPDATE 平均响应时间 毫秒
system_event_commit_count 提交类系统事件数
system_event_commit_waites 提交类等待事件数
system_event_concurrency_count 并发类系统事件数
system_event_concurrency_waites 并发类等待事件数
system_event_configuration_count 配置类系统事件数
system_event_configuration_time_waites 配置类等待事件数
system_event_network_count 网络类系统事件数
system_event_network_waites 网络类等待事件数
system_event_other_count 其他系统事件数
system_event_other_time_waites 其他等待事件数
system_event_system_io_count 系统 IO 事件数
system_event_system_io_waites 系统 IO 等待事件数
system_event_user_io_count 用户 IO 事件数
system_event_user_io_waites 用户 IO 等待事件数
total_memstore_used MemStore 总使用量 字节
tps 每秒事务数 次/秒
trans_commit_log_count 事务提交日志数
trans_commit_log_sync_rt 事务提交日志同步耗时 毫秒
transaction_commit_count 事务提交数
transaction_commit_rt 事务提交耗时 毫秒
transaction_count 事务总数
transaction_multi_partition_count 跨分区事务数
transaction_partition_count 事务涉及分区数
transaction_rollback_count 事务回滚数
transaction_rollback_rt 事务回滚耗时 毫秒
transaction_rt 事务平均响应时间 毫秒
transaction_single_partition_count 单分区事务数
transaction_timeout_count 事务超时数
uptime 运行时长
wait_event_count 等待事件总数
wait_event_rt 等待事件平均耗时 毫秒

对象

采集到的阿里云 OceanBase 对象数据结构, 可以从「基础设施-自定义」里看到对象数据,目前主要有两种对象数据:

  • aliyun_oceanbase:阿里云 OceanBase 实例对象
  • aliyun_oceanbase_tenant:阿里云 OceanBase 实例下的租户对象

aliyun_oceanbase

  {
    "fields": {
      "Cpu": 4,
      "CpuArchitecture": "X86",
      "CreateTime": "2025-09-26T02:33:47Z",
      "DataDiskAutoScaleConfig": "{\"AutoScale\": false, \"MaxDiskSize\": 64000.0}",
      "DeployMode": "1-1-1",
      "DeployType": "single",
      "DiskSize": 50,
      "ExpireTime": "2125-09-26T16:00:00Z",
      "InstanceClass": "4C16G",
      "InstanceId": "ob73ypcm3mtr28",
      "InstanceName": "ob_0926",
      "InstanceRole": "NORMAL",
      "InstanceType": "K8s_DEDICATED",
      "Mem": 16,
      "PayType": "POSTPAY",
      "message": "...."
      ...
    },
    "measurement": "aliyun_oceanbase",
    "tags": {
      "ClusterId": "ob73ypcm3mtr28",
      "ClusterName": "ob_0926",
      "ClusterRole": "NORMAL",
      "ClusterType": "K8s_DEDICATED",
      "ProxyClusterId": "proxy-73yrq8mzxxx",
      "RegionId": "cn-shenzhen",
      "ResourceGroupId": "rg-aekzsli74qdxxxx",
      "name": "ob73ypcm3mtr28"
    }
  }

aliyun_oceanbase_tenant

  {
    "fields": {
      "Cpu": 1,
      "CreateTime": "2025-09-26T03:34:31Z",
      "Mem": 4,
      "Status": "ONLINE",
      "TenantMode": "MySQL",
      "message": "...."
    },
    "measurement": "aliyun_oceanbase_tenant",
    "tags": {
      "ClusterId": "ob73ypcm3mtr28",
      "ClusterName": "ob_0926",
      "ClusterRole": "NORMAL",
      "ClusterType": "K8s_DEDICATED",
      "PrimaryZone": "cn-shenzhen-d",
      "ProxyClusterId": "proxy-73yrq8mzwddd",
      "RegionId": "cn-shenzhen",
      "ResourceGroupId": "rg-aekzsli74qdxxxx",
      "TenantId": "t73yursgglxeo",
      "TenantName": "mall",
      "name": "t73yursgglxeo"
    }
  }

文档评价

文档内容是否对您有帮助? ×