Trace Debuger
Use this skill to generate a self-contained Markdown trace debug report.
Inputs
- -
trace_id (required) - INLINECODE1 (optional, default
http://127.0.0.1:16686) - INLINECODE3 (optional, default
http://127.0.0.1:9200) - INLINECODE5 (optional, absolute path, default
/Users/noodles/Desktop/code/go-components/examples/tracer) - INLINECODE7 (optional, default
./trace_debug_report_{trace_id}.md) - INLINECODE9 (optional, default
filebeat-tracer-*) - INLINECODE11 (optional, default
2000)
Run
CODEBLOCK0
Output
- - Writes Markdown report to INLINECODE13
- MUST send the generated Markdown report to the user as a file attachment via the chat window in the same session before finishing the task
- MUST send the report as ONE chat message only: attach the Markdown file and put the strict summary block in the same message caption/body.
【markdown报告文件】 is a placeholder and MUST be replaced with the real uploaded Markdown filename (example: trace_debug_report_<trace_id>.md).- Use exactly this format in caption/body:
CODEBLOCK1
- - Prints fixed summary lines to stdout:
CODEBLOCK2
Notes
- - Keep logs sorted by timestamp ascending.
- After fetching ES logs, run Codex in repository root (automated via
codex exec equivalent to TUI paste workflow) with this prompt:
-
这是我的日志,请根据日志结合代码帮我排查分析bug,输出bug原因及解决方案,必须保持固定的格式。
- - If repository is provided, include code-context hints and file matches for suspected bug areas.
- If repository is not provided, base bug hypotheses on logs + spans only.
- After analysis in chat workflow: send the generated Markdown report as a file attachment to the user through the chat window, with the strict summary block in the same message caption/body (single message only).
- The first line must be the real Markdown filename (not placeholder text).
- Finally, delete the local Markdown file.
Trace Debuger
使用此技能生成一个独立的 Markdown 追踪调试报告。
输入参数
- - traceid(必填)
- jaegerurl(可选,默认值 http://127.0.0.1:16686)
- esurl(可选,默认值 http://127.0.0.1:9200)
- repopath(可选,绝对路径,默认值 /Users/noodles/Desktop/code/go-components/examples/tracer)
- outputpath(可选,默认值 ./tracedebugreport{traceid}.md)
- esindex(可选,默认值 filebeat-tracer-*)
- es_size(可选,默认值 2000)
运行方式
bash
python3 skills/tracedebuger/scripts/tracedebuger.py \
--trace-id \
[--jaeger-url http://127.0.0.1:16686] \
[--es-url http://127.0.0.1:9200] \
[--repo-path /Users/noodles/Desktop/code/go-components/examples/tracer] \
[--output-path ./tracedebugreportID>.md]
输出内容
- - 将 Markdown 报告写入 outputpath
- 必须在完成任务前,通过同一会话的聊天窗口将生成的 Markdown 报告作为文件附件发送给用户
- 必须仅用一条聊天消息发送报告:将 Markdown 文件作为附件,并在同一条消息的标题/正文中放入严格的摘要块。
- 【markdown报告文件】 是一个占位符,必须替换为实际上传的 Markdown 文件名(例如:tracedebugreport.md)。
- 在标题/正文中严格使用以下格式:
text
<真实markdown报告文件名>
trace_id: xxxx
status: xxx
jaeger_url: xxx
es_url: xxx
代码仓库路径:仓库路径
关键结论摘要:xxxx
text
traceid: id>
status: SUCCESS/FAIL
jaegerurl: url>
esurl: url>
代码仓库路径:
关键结论摘要:
注意事项
- - 保持日志按时间戳升序排列。
- 获取 ES 日志后,在仓库根目录下运行 Codex(通过 codex exec 自动执行,相当于 TUI 粘贴工作流),使用以下提示词:
- 这是我的日志,请根据日志结合代码帮我排查分析bug,输出bug原因及解决方案,必须保持固定的格式。
- - 如果提供了仓库路径,需包含代码上下文提示和疑似 bug 区域的文件匹配信息。
- 如果未提供仓库路径,则仅基于日志和跨度信息提出 bug 假设。
- 在聊天工作流中完成分析后:通过聊天窗口将生成的 Markdown 报告 作为文件附件 发送给用户,并在 同一条消息 的标题/正文中附带严格的摘要块(仅单条消息)。
- 第一行必须是真实的 Markdown 文件名(而非占位符文本)。
- 最后,删除本地的 Markdown 文件。