Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ python3 $SCRIPTS/troubleshoot.py <log_file> --start "16:00" --end "17:00" --erro
- **终端**:简洁三层汇总(Router / FD 后端 / 客户端),含状态码分布、错误 Top N、趋势图
- **文件**:详细报告导出到 `skill_output/troubleshoot/<YYYYMMDD_HHMMSS>/summary/troubleshoot_report.md`
- 逐分钟事件详情拆分到 `detail/health_events.md`
- 请求追踪事件链拆分到 `detail/trace_<ID>.md`
- 请求追踪事件链拆分到 `detail/trace/trace_<ID>.md`
- **Cache 明细要求**:`cache_session_stickiness.md` / `cache_suboptimal.md` / `cache_eviction.md` / `cache_fallback.md` / `cache_cross.md`
必须始终生成(即使无异常也写“未发现/样本不足”总结,避免链接缺失)
- **状态行**:`STATUS: HEALTHY / DEGRADED / CRITICAL`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
- `detail/latency_diagnoses.md` — 延迟诊断详情
- `detail/cache_diagnosis.md` — cache 六维诊断详情(session 粘性/非最优/驱逐/Fallback/冷启动/交叉诊断)
- `detail/cache_session_stickiness.md` / `detail/cache_suboptimal.md` / `detail/cache_eviction.md` / `detail/cache_fallback.md` / `detail/cache_cross.md` — cache 分职责拆分明细
- `detail/trace_<ID>.md` — 请求追踪事件链
- `detail/trace/trace_<ID>.md` — 请求追踪事件链

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,9 @@ def format_trace_report(result):
# 主报告中添加引用和摘要
safe_tid = tid.replace("/", "_")
sections.append(f' 事件数: {len(trace["events"])}')
sections.append(f" > 完整事件链: [detail/trace_{safe_tid}.md](../detail/trace_{safe_tid}.md)")
sections.append(
f" > 完整事件链: [detail/trace/trace_{safe_tid}.md](../detail/trace/trace_{safe_tid}.md)"
)
sections.append("")

return "\n".join(sections), detail_dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def format_full_report(results, status, status_reason):
details: dict 包含需要拆分到独立文件的详情数据
- 'health_events': str 或 None
- 'load_select_release': str 或 None
- 'trace_files': {trace_id: text} 或 {}
- 'trace_files': {trace_id: text} 或 {}(写入 detail/trace/)
"""
parts = []
details = {
Expand Down Expand Up @@ -419,9 +419,12 @@ def save_detailed_report(report_text, output_dir, details=None):
with open(os.path.join(detail_dir, "errors_topn.md"), "w", encoding="utf-8") as f:
f.write(details["errors_topn"])

trace_detail_dir = os.path.join(detail_dir, "trace")
if details.get("trace_files"):
os.makedirs(trace_detail_dir, exist_ok=True)
for trace_id, trace_text in details.get("trace_files", {}).items():
safe_id = trace_id.replace("/", "_")
trace_path = os.path.join(detail_dir, f"trace_{safe_id}.md")
trace_path = os.path.join(trace_detail_dir, f"trace_{safe_id}.md")
with open(trace_path, "w", encoding="utf-8") as f:
f.write(trace_text)

Expand Down
Loading