Obproxy log analysis

From oceanbase/obdiag · View interactive version

Obproxy log analysis is an AI agent skill from the GitHub repository oceanbase/obdiag. 标准 SOP:OBProxy 日志采集(gather_obproxy_log)、包内解读(file_list/file_read/run_shell 解压)、可选巡检。用户提到 OBProxy/代理/obproxy_diagnosis 等时使用;与 observer 侧 observer-log-analysis 互斥 analyze_log。

How to use this skill

Skill file

OBProxy 日志:采集与分析

与 observer 日志的区别

使用场景

同一轮对话内链式完成(重要)

模型常在 gather_obproxy_log 成功后就说「采集完成」并结束本轮,不会自动再调 file_list / file_read。若用户一句里包含 采集 + 分析/解读,或明确要 分析 OBProxy 日志,必须在 同一轮 agent 运行里 连续调用工具:gather_obproxy_log → file_list(采集输出目录)→ file_read(相关文件)→ 最后再用自然语言总结。仅当用户只要采集、不要解读时,才可以 gather 后直接回复。

推荐流程

1. 采集(需要从新从机器拉日志时)

2. 解读已采集的包(用户说「分析 / 解读 / 看看」且已有采集目录时)

1. 使用 file_list 列出子目录与文件;必要时用 pattern(如 *.tar.gz、*.zip、*diagnosis*)缩小范围。

2. 若为压缩包(常见:*.tar.gz、*.tgz、*.zip):日志往往在包内,先解压再读。

3. 对明文日志文件使用 file_read(注意单文件大小上限;过大时用 run_shell 执行 head/tail/grep 抽样,或让用户缩小范围)。

4. 根据内容归纳错误、时间线、建议下一步(例如是否需扩大 since、换 scope、或结合 check_cluster)。

3. 结构化巡检(可选)

```

check_cluster(obproxy_tasks="obproxy_task1,obproxy_task2")

# 或

check_cluster(obproxy_cases="obproxy_check1,obproxy_check2")

```

与「读原始 diagnosis 文本」不同,走的是 obdiag check run 的内置规则引擎。

阶段完成标准(SOP)

| 阶段 | 完成标准 |

|------|----------|

| 1 采集 | 已调用 gather_obproxy_log 且掌握 输出 pack 路径(或明确失败原因)。 |

| 2 解读 | 已对目标目录 file_list,对明文日志 file_read 或 run_shell 解压/抽样;不得对 .tar.gz/.zip 直接当文本读。 |

| 3 巡检(若做) | 已执行对应 check 工具或已给出 CLI 替代说明。 |

自检清单

工具速查

| 目的 | 工具 |

|------|------|

| 拉 OBProxy 日志 | gather_obproxy_log |

| 在采集结果目录里找文件 | file_list |

| 解压 .tar.gz / .zip、查看包内列表、head/grep 抽样 | run_shell(需用户确认,勿执行破坏性/无关命令) |

| 读取日志内容 | file_read |

| Observer 日志统计/分析 | analyze_log(仅 observer 侧,勿用于 OBProxy) |

常见错误

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.