Skip to content

Commit

Permalink
Merge pull request #175 from Teingi/master
Browse files Browse the repository at this point in the history
hard code gather scene add gather observer.base & update README
  • Loading branch information
wayyoungboy authored Apr 22, 2024
2 parents 3c20639 + 74f4a10 commit b641067
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 55 deletions.
52 changes: 24 additions & 28 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,49 +62,45 @@ obdiag config -h <db_host> -u <sys_user> [-p password] [-P port]
```

# obdiag 功能
- 一键集群巡检
- 一键诊断分析
- 一键根因分析
- 一键信息采集

## obdiag 巡检功能
- [一键巡检](./docs/check.md)

## obdiag 一键场景化信息采集功能
- [一键场景化信息采集](./docs/gather_scene.md)
# 参与贡献

## obdiag 一键信息采集功能
obdiag 期望构建一个开放的社区,我们欢迎任何形式的贡献,您可以:
- 通过 [Issues](https://github.com/oceanbase/oceanbase-diagnostic-tool/issues) 提交 bug。
- 通过 [Discussion](https://github.com/oceanbase/oceanbase-diagnostic-tool/discussions) 参与或发起讨论。
- 通过 [Pull requests](https://github.com/oceanbase/oceanbase-diagnostic-tool/pulls) 提交问题修复或者功能特性。

- [一键收集OB日志](./docs/gather_ob_log.md)
- [一键收集AWR报告](./docs/gather_awr.md)
- [一键收集主机信息](./docs/gather_sysstat.md)
- [一键收集slog/clog日志](./docs/gather_admin.md)
- [一键收集火焰图信息](./docs/gather_perf.md)
- [一键收集OB堆栈信息](./docs/gather_ob_stack.md)
- [一键收集并行SQL的执行详情信息](./docs/gather_sql_plan_monitor.md)
- [一键收集OBPROXY日志](./docs/gather_obproxy_log.md)
- [一键收集AWR报告](./docs/gather_awr.md)
- [一键收集全部诊断信息](./docs/gather_all.md)
# Roadmap Ahead

## obdiag 一键分析功能说明
- [一键分析OB日志](./docs/analyze_ob_log.md)
- [一键全链路诊断](./docs/analyze_flt_trace.md)
| 版本 | 迭代周期 | 功能点 |
|---------|---------------|---------|
|1.6.0| 2024.01| <ul><li> 场景化信息采集 </li><li> 场景化根因分析 </li></ul> |
|2.0.0|2024.03| <ul><li> context改造,场景化扩展能力增强 </li><li> 支持在线更新巡检、采集的task </li><li> 根因分析二期 </li></ul>|
|2.1.0|2024.04| <ul><li> 根因分析场景扩展 </li><li> 新增 tabledump 采集 </li></ul>|
|2.2.0|2024.05| <ul><li> 根因分析场景扩展 </li></ul>|
|2.3.0|2024.06| <ul><li> 根因分析场景扩展 </li><li> 支持 SQL 诊断 </li></ul>|
|2.4.0|2024.07| <ul><li> 根因分析场景扩展 </li><li> 适配两款内核的诊断工具 </li></ul>|
|2.5.0|2024.08| <ul><li> 根因分析场景扩展 </li><li> 支持 OMS 诊断 </li></ul>|
|3.0.0|2024.09| <ul><li> 根因分析场景扩展 </li><li> 服务化改造 </li></ul>|
|3.1.0|2024.10| <ul><li> 根因分析场景扩展 </li><li> 支持巡检报告比对 </li></ul>|
|3.2.0|2024.11| <ul><li> 根因分析场景扩展 </li><li> SQL 诊断二期,支持SQL问题的根因分析 </li></ul>|
|3.3.0|2024.12| <ul><li> AI 化探索 </li></ul>|

## obdiag 一键场景化根因分析功能
- [一键场景化根因分析](./docs/rca.md)

# 许可证

OceanBase Diagnostic Tool 使用 [MulanPSL - 2.0](http://license.coscl.org.cn/MulanPSL2) 许可证。
您可以免费复制及使用源代码。当您修改或分发源代码时,请遵守木兰协议。


## 贡献

我们热烈欢迎并高度赞赏您的贡献。您可以通过以下几种方式做出贡献:

- 向我们提出一个[issue](https://github.com/oceanbase/oceanbase-diagnostic-tool/issues)
- 提交请求。

## 支持

如果您在使用 OceanBase LogProxy 时遇到任何问题,欢迎联系我们寻求帮助:

- [GitHub Issue](https://github.com/oceanbase/oceanbase-diagnostic-tool/issues)
- [官方网站](https://www.oceanbase.com/docs/obdiag-cn)
- obdiag SIG 微信号: obdiagsig
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,48 +64,48 @@ obdiag config -h <db_host> -u <sys_user> [-p password] [-P port]
```

# obdiag Fuctions
- One-click cluster inspection
- One-click diagnostic analyze
- One-click root cause analysis
- One-click information collection

## obdiag check Fuctions
- [check](./docs/check.md)
For more details, please refer to [Official docs](https://www.oceanbase.com/docs/obdiag-cn)

## obdiag gather scene Fuctions
- [gather scene](./docs/gather_scene.md)
# Join the Contributing Community

## obdiag gather Fuctions
obdiag envisions an open community. We welcome your contributions in any form:

- [gather log](./docs/gather_ob_log.md)
- [gather sysstat](./docs/gather_sysstat.md)
- [gather slog/clog](./docs/gather_admin.md)
- [gather perf](./docs/gather_perf.md)
- [gather obstack](./docs/gather_ob_stack.md)
- [gather sql plan monitor](./docs/gather_sql_plan_monitor.md)
- [gather obproxy_log](./docs/gather_obproxy_log.md)
- [gather awr](./docs/gather_awr.md)
- [gather all](./docs/gather_all.md)
- Report bugs through [Issues](https://github.com/oceanbase/oceanbase-diagnostic-tool/issues).
- Participate in or initiate discussions via [Discussion](https://github.com/oceanbase/oceanbase-diagnostic-tool/discussions).
- Contribute bug fixes or new features through [Pull requests](https://github.com/oceanbase/oceanbase-diagnostic-tool/pulls).

## obdiag analyze Fuctions
- [analyze log](./docs/analyze_ob_log.md)
- [analyze flt trace log](./docs/analyze_flt_trace.md)

## obdiag rca Fuctions
- [rca](./docs/rca.md)

# Roadmap Ahead

| Version | Iteration Period | Function |
|---------|---------------|---------|
|1.6.0| 2024.01| <ul><li> Scenario based fault information collection </li><li> Scenario based root cause analysis </li></ul> |
|2.0.0|2024.03| <ul><li> Context Transformation, Enhanced Scene Expansion Capabilities</li><li> Support online updating of inspection and gather tasks </li><li>Root Cause Analysis Phase II Transformation </li></ul>|
|2.1.0|2024.04| <ul><li> Root Cause Analysis Scenario Expansion </li><li> Gather tabledump </li></ul>|
|2.2.0|2024.05| <ul><li> Root Cause Analysis Scenario Expansion </li></ul>|
|2.3.0|2024.06| <ul><li> Root Cause Analysis Scenario Expansion </li><li> Support SQL Diagnosis </li></ul>|
|2.4.0|2024.07| <ul><li> Root Cause Analysis Scenario Expansion </li><li> Adapting Two Additional Kernel Diagnostic Tools </li></ul>|
|2.5.0|2024.08| <ul><li> Root Cause Analysis Scenario Expansion </li><li> Support OMS Diagnosis </li></ul>|
|3.0.0|2024.09| <ul><li> Root Cause Analysis Scenario Expansion </li><li> Service-ification Transformation </li></ul>|
|3.1.0|2024.10| <ul><li> Root Cause Analysis Scenario Expansion </li><li> Supporting Comparative Functionality for Patrol Inspection Reports </li></ul>|
|3.2.0|2024.11| <ul><li> Root Cause Analysis Scenario Expansion </li><li> SQL Diagnosis Phase II, Supporting Root Cause Analysis for SQL problems </li></ul>|
|3.3.0|2024.12| <ul><li> AI for obdiag </li></ul>|

# Licencing
OceanBase Database is under MulanPubL - 2.0 license. You can freely copy and use the source code. When you modify or
distribute the source code, please obey the MulanPubL - 2.0 license.


# Contributing

Contributions are warmly welcomed and greatly appreciated. Here are a few ways you can contribute:

- Raise us an [issue](https://github.com/oceanbase/oceanbase-diagnostic-tool/issues).
- Submit Pull Requests.

# Support

In case you have any problems when using obdiag, welcome reach out for help:

- [GitHub Issue](https://github.com/oceanbase/oceanbase-diagnostic-tool/issues)
- [Official Website](https://www.oceanbase.com/docs/obdiag-cn)
- obdiag SIG WeChat: obdiagsig

4 changes: 4 additions & 0 deletions handler/gather/gather_scenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ def __init_task_names(self):
self.yaml_tasks[item] = yaml_task_data
else:
self.stdio.error("Invalid Task :{0}".format(item))
# hard code add gather observer.base
if len(self.code_tasks) > 0:
yaml_task_base = scene.get_one_yaml_task("observer.base")
self.yaml_tasks["observer.base"] = yaml_task_base
else:
self.stdio.error("get task name failed")

Expand Down
68 changes: 68 additions & 0 deletions handler/gather/tasks/observer/base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
info_en: "[cluster base info]"
info_cn: "[集群基础信息]"
command: obdiag gather scene run --scene=observer.base
task:
- version: "[2.0.0.0, 4.0.0.0]"
steps:
- type: sql
sql: "show variables like 'version_comment';"
global: true
- type: sql
sql: "SELECT * FROM oceanbase.v$ob_cluster"
global: true
- type: sql
sql: "SELECT * FROM oceanbase.__all_zone WHERE name='idc';"
global: true
- type: sql
sql: "select svr_ip,zone,with_rootserver,status,block_migrate_in_time,start_service_time,stop_time,build_version from oceanbase.__all_server order by zone;"
global: true
- type: sql
sql: "SELECT zone, concat(svr_ip, ':', svr_port) observer, cpu_capacity, cpu_total, cpu_assigned, cpu_assigned_percent, mem_capacity, mem_total, mem_assigned, mem_assigned_percent, unit_Num, round(`load`, 2) `load`, round(cpu_weight, 2) cpu_weight, round(memory_weight, 2) mem_weight, leader_count FROM oceanbase.__all_virtual_server_stat ORDER BY zone,svr_ip;"
global: true
- type: sql
sql: "select tenant_id,tenant_name,primary_zone,compatibility_mode from oceanbase.__all_tenant;"
global: true
- type: sql
sql: "show parameters like '%syslog_level%';"
global: true
- type: sql
sql: "show parameters like '%syslog_io_bandwidth_limit%';"
global: true
- type: sql
sql: "select count(*),tenant_id,zone_list,unit_count from oceanbase.__all_resource_pool group by tenant_id,zone_list,unit_count;"
global: true
- type: sql
sql: "show parameters"
global: true
- version: "[4.0.0.0, *]"
steps:
- type: sql
sql: "show variables like 'version_comment';"
global: true
- type: sql
sql: "SELECT * FROM oceanbase.DBA_OB_ZONES;"
global: true
- type: sql
sql: "SELECT * FROM oceanbase.DBA_OB_SERVERS;"
global: true
- type: sql
sql: "SELECT * FROM oceanbase.GV$OB_SERVERS;"
global: true
- type: sql
sql: "SELECT * FROM oceanbase.DBA_OB_UNIT_CONFIGS;"
global: true
- type: sql
sql: "SELECT * FROM oceanbase.DBA_OB_RESOURCE_POOLS;"
global: true
- type: sql
sql: "SELECT * FROM oceanbase.DBA_OB_TENANTS;"
global: true
- type: sql
sql: "SELECT c.TENANT_ID, e.TENANT_NAME, concat(c.NAME, ': ', d.NAME) `pool:conf`,concat(c.UNIT_COUNT, ' unit: ', d.min_cpu, 'C/', ROUND(d.MEMORY_SIZE/1024/1024/1024,0), 'G') unit_info FROM oceanbase.DBA_OB_RESOURCE_POOLS c, oceanbase.DBA_OB_UNIT_CONFIGS d, oceanbase.DBA_OB_TENANTS e WHERE c.UNIT_CONFIG_ID=d.UNIT_CONFIG_ID AND c.TENANT_ID=e.TENANT_ID AND c.TENANT_ID>1000 ORDER BY c.TENANT_ID;"
global: true
- type: sql
sql: "SELECT a.TENANT_NAME,a.TENANT_ID,b.SVR_IP FROM oceanbase.DBA_OB_TENANTS a, oceanbase.GV$OB_UNITS b WHERE a.TENANT_ID=b.TENANT_ID;"
global: true
- type: sql
sql: "show parameters"
global: true

0 comments on commit b641067

Please sign in to comment.