Files
scaffold/template/.claude/rules/observability.md
T
baozaotumao 39fe248f9f feat: 重组为标准 skill 包结构 + 修复 verify.sh bash 3.2 兼容
- 新增 .claude/skills/new-project/SKILL.md(标准 skill 格式)
- install-skill.sh 安装时组装 SKILL.md + verify.sh,单一源无重复
- verify.sh 改用索引数组替代 declare -A,兼容 macOS bash 3.2
- log_pass/log_skip 显式 return 0,避免 set -e 下非 verbose 误退出
- README 改为 skill 优先;补全 copier.yml/scripts/template 入库
2026-06-01 21:19:45 -07:00

20 lines
934 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
paths: ["backend/**", "agent/**", "frontend/**"]
---
# 可观测性
> correlation_id 全链路 + 结构化日志 + 健康探针。
- **correlation_id 贯穿全链路**:前端生成 → WS header/首帧带上 → Backend(作 request_id)→ Agent(随 session_id 一起进日志)。三层日志可用同一 id 串联检索。
- **结构化日志**:JSON 每行一条(见各服务 logging 章节)
| 层 | 文件 | 格式 |
|----|------|------|
| Backend | `~/ppt-gen/logs/backend.log` | JSON,每行一条,含 request_id |
| Agent | `~/ppt-gen/logs/agent.log` | JSON,每行一条,含 session_id |
| Frontend | consoledev/ 可接 Sentryprod | 结构化对象 |
- **探针**:每个服务暴露 `GET /health`(存活)与 `GET /ready`(依赖就绪,如 Agent 检查 skill 已装、Chromium 可启动)
- 禁止 `print()` / `console.log()`,统一用各层 logger(见 `conventions.md`