https://gitcode.net/oceanbase/obagent/-/commit/8018e5754d0f3760da3d7d258d350e07512bb041realize the adaptation to OB 4.0. Add rootService judgment and OB version...2022-09-14T20:10:14+08:00alv00alv.dj@oceanbase.comrealize the adaptation to OB 4.0. Add rootService judgment and OB version judgment, and modify the collection configuration of ob_table, ob_plan_cache, and ob_index. Achieve compatibility with OB v3.x and v4.x
https://gitcode.net/oceanbase/obagent/-/commit/f028935eb8725d46445f9119d994258ffd705309realize the adaptation to OB 4.0. Add rootService judgment and OB version...2022-09-14T20:12:46+08:00alv00alv.dj@oceanbase.comrealize the adaptation to OB 4.0. Add rootService judgment and OB version judgment, and modify the collection configuration of ob_table, ob_plan_cache, and ob_index. Achieve compatibility with OB v3.x and v4.x
https://gitcode.net/oceanbase/obagent/-/commit/a62b8bc45f637af8a20e6c70a9f5956cd3967b51fix some config2022-09-16T11:18:41+08:00xueranxin.sunhx@alibaba-inc.comhttps://gitcode.net/oceanbase/obagent/-/commit/39649e992af7f7808a02cce98f6fd71d0f1c90a4support host monitor2022-09-19T10:23:48+08:00alv00alv.dj@oceanbase.comhttps://gitcode.net/oceanbase/obagent/-/commit/68eb9d9e19c047da9aa590de54aad23a3fdad3e5add metric 'ob_role_with_rootserver',change the 'condition' in monitor_ob.yam...2022-09-19T16:37:58+08:00alv00alv.dj@oceanbase.comadd metric 'ob_role_with_rootserver',change the 'condition' in monitor_ob.yaml from string type to array type to support multi-condition configuration
https://gitcode.net/oceanbase/obagent/-/commit/2525cbba4c7e7f13ea94559f2f994e91493723c9Merge branch 'adaptV4' into 'master'2022-09-20T10:45:32+08:00雪染xin.sunhx@alibaba-inc.com
Adapt v4
See merge request !1754150
sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ with_rootserver from __all_server where svr_ip = ? and svr_port = ?
-name:ob_role
sqlSlowThreshold:100ms
metrics:
is_rootserver:with_rootserver
conditionValues:
ob_is_rootservice:with_rootserver
conditions:[ob_is_v4]
params:[ob_svr_ip,ob_svr_port]
sql:select (case when with_rootserver='YES' then 1 else 0 end) as with_rootserver from DBA_OB_SERVERS where svr_ip = ? and svr_port = ?
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ tenant_name, cache_name, cache_size from __all_virtual_kvcache_info, __all_tenant where __all_tenant.tenant_id = __all_virtual_kvcache_info.tenant_id and svr_ip = ? and svr_port = ?
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ tenant_name, cache_name, cache_size from __all_virtual_kvcache_info, __all_tenant where __all_tenant.tenant_id = __all_virtual_kvcache_info.tenant_id and svr_ip = ? and svr_port = ?
params:[ob_svr_ip,ob_svr_port]
params:[ob_svr_ip,ob_svr_port]
name:ob_cache
name:ob_cache
...
@@ -52,7 +83,17 @@ obInputBasic: &obInputBasic
...
@@ -52,7 +83,17 @@ obInputBasic: &obInputBasic
cacheDataExpire:120s
cacheDataExpire:120s
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) QUERY_TIMEOUT(100000000) */ tenant_name, count(*) as cnt from gv$table group by tenant_id
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) QUERY_TIMEOUT(100000000) */ tenant_name, count(*) as cnt from gv$table group by tenant_id
name:ob_table
name:ob_table
condition:ob_is_rootservice
conditions:[ob_is_v3,ob_is_rootservice]
tags:
tenant_name:tenant_name
metrics:
num:cnt
enableCache:true
cacheExpire:1h
cacheDataExpire:2h
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) QUERY_TIMEOUT(100000000) */ tenant_name, count(*) as cnt from CDB_TABLES join __all_tenant on CDB_TABLES.con_id = __all_tenant.tenant_id group by con_id
name:ob_table
conditions:[ob_is_v4,ob_is_rootservice]
tags:
tags:
tenant_name:tenant_name
tenant_name:tenant_name
metrics:
metrics:
...
@@ -75,8 +116,19 @@ obInputBasic: &obInputBasic
...
@@ -75,8 +116,19 @@ obInputBasic: &obInputBasic
metrics:
metrics:
stat:value
stat:value
current_timestamp:current
current_timestamp:current
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ tenant_name, mem_used, access_count, hit_count from v$plan_cache_stat join __all_tenant on v$plan_cache_stat.tenant_id = __all_tenant.tenant_id
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ tenant_name, mem_used, access_count, hit_count from v$plan_cache_stat join __all_tenant on v$plan_cache_stat.tenant_id = __all_tenant.tenant_id group by tenant_name
name:ob_plan_cache
name:ob_plan_cache
conditions:[ob_is_v3]
tags:
tenant_name:tenant_name
metrics:
memory_bytes:mem_used
access_total:access_count
hit_total:hit_count
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ tenant_name, mem_used, access_count, hit_count from V$OB_PLAN_CACHE_STAT join __all_tenant on V$OB_PLAN_CACHE_STAT.tenant_id = __all_tenant.tenant_id group by tenant_name
name:ob_plan_cache
condition:[ob_is_v4]
tags:
tags:
tenant_name:tenant_name
tenant_name:tenant_name
metrics:
metrics:
...
@@ -114,8 +166,37 @@ obInputExtra: &obInputExtra
...
@@ -114,8 +166,37 @@ obInputExtra: &obInputExtra
defaultConditionValues:
defaultConditionValues:
ob_svr_ip:${monagent.host.ip}
ob_svr_ip:${monagent.host.ip}
ob_svr_port:${monagent.ob.rpc.port}
ob_svr_port:${monagent.ob.rpc.port}
ob_is_rootservice:true
ob_is_rootservice:false
ob_is_v4:false
ob_is_v3:false
collectConfig:
collectConfig:
-sql:select ob_version() REGEXP '^4' as ob_is_v4
name:ob_is_v4
conditionValues:
ob_is_v4:ob_is_v4
-sql:select ob_version() REGEXP '^3' as ob_is_v3
name:ob_is_v3
conditionValues:
ob_is_v3:ob_is_v3
-name:ob_role
sqlSlowThreshold:100ms
metrics:
is_rootserver:with_rootserver
conditionValues:
ob_is_rootservice:with_rootserver
conditions:[ob_is_v3]
params:[ob_svr_ip,ob_svr_port]
sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ with_rootserver from __all_server where svr_ip = ? and svr_port = ?
-name:ob_role
sqlSlowThreshold:100ms
metrics:
is_rootserver:with_rootserver
conditionValues:
ob_is_rootservice:with_rootserver
conditions:[ob_is_v4]
params:[ob_svr_ip,ob_svr_port]
sql:select (case when with_rootserver='YES' then 1 else 0 end) as with_rootserver from DBA_OB_SERVERS where svr_ip = ? and svr_port = ?
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ count(*) as cnt from v$unit
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ count(*) as cnt from v$unit
name:ob_unit
name:ob_unit
metrics:
metrics:
...
@@ -150,12 +231,17 @@ obInputExtra: &obInputExtra
...
@@ -150,12 +231,17 @@ obInputExtra: &obInputExtra
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ count(1) as cnt from __all_virtual_trans_stat where part_trans_action > 2 and ctx_create_time < date_sub(now(), interval 600 second) and svr_ip = ? and svr_port = ?
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ count(1) as cnt from __all_virtual_trans_stat where part_trans_action > 2 and ctx_create_time < date_sub(now(), interval 600 second) and svr_ip = ? and svr_port = ?
params:[ob_svr_ip,ob_svr_port]
params:[ob_svr_ip,ob_svr_port]
name:ob_trans
name:ob_trans
condition:ob_is_rootservice
conditions:[ob_is_rootservice]
metrics:
metrics:
expire_num:cnt
expire_num:cnt
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) QUERY_TIMEOUT(100000000) */ count(*) as cnt from gv$table where table_type in (5) and index_status in (5, 6)
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) QUERY_TIMEOUT(100000000) */ count(*) as cnt from gv$table where table_type in (5) and index_status in (5, 6)
name:ob_index
name:ob_index
condition:ob_is_rootservice
conditions:[ob_is_v3,ob_is_rootservice]
metrics:
error_num:cnt
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) QUERY_TIMEOUT(100000000) */ count(*) as cnt from CDB_INDEXES where table_type in (5) and status in (5, 6)
name:ob_index
conditions:[ob_is_v4,ob_is_rootservice]
metrics:
metrics:
error_num:cnt
error_num:cnt
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ __all_tenant.tenant_name, active, total, freeze_trigger, freeze_cnt from gv$memstore, __all_tenant where gv$memstore.tenant_id = __all_tenant.tenant_id and ip = ? and port = ?
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ __all_tenant.tenant_name, active, total, freeze_trigger, freeze_cnt from gv$memstore, __all_tenant where gv$memstore.tenant_id = __all_tenant.tenant_id and ip = ? and port = ?
...
@@ -189,12 +275,13 @@ obInputExtra: &obInputExtra
...
@@ -189,12 +275,13 @@ obInputExtra: &obInputExtra
min_iops:min_iops
min_iops:min_iops
max_disk_size_bytes:max_disk_size
max_disk_size_bytes:max_disk_size
max_session_num:max_session_num
max_session_num:max_session_num
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ tenant_name, tenant_id, name, gets, misses, sleeps, immediate_gets, immediate_misses, spin_gets, wait_time / 1000000 as wait_time from v$latch, __all_tenant where __all_tenant.tenant_id = v$latch.con_id
-sql:select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ tenant_name, tenant_id, `latch#` as latch_no, name, gets, misses, sleeps, immediate_gets, immediate_misses, spin_gets, wait_time / 1000000 as wait_time from v$latch, __all_tenant where __all_tenant.tenant_id = v$latch.con_id