docs(usage): phase 2 final 3 — logs-stats + recording + troubleshooting#183
Merged
Conversation
…hooting (#167) 收尾使用侧 9 篇,至此 Phase 2 使用指南全部完成。 - logs-stats:request_logs 40+ 列分组列出,重点讲 PR #170/#171 的 duration_ms INT4 clamp、stale reconcile (status_code=520) 兜底; /api/admin/logs 的 query 参数集(无 model 过滤)、/api/admin/logs/live SSE 与多副本下的进程内 pub/sub 限制;overview / timeseries / leaderboard 三类聚合的实时计算口径,特别是 TPS 的多重过滤条件;明确指出 LOG_RETENTION_DAYS 当前无后台清理任务消费、表实际无限增长,给出手动 DELETE 的兜底方案。 - request-recording:Runtime Settings 主控(env 已弃用,shouldRecordFixture 只读 DB),默认 enabled=false / mode=failure;磁盘布局含 latest.json 双写、16 MiB 截断、compactSSEChunks 对 OpenAI Responses 大型快照事件 的 instructions/tools 替换;脱敏的 SENSITIVE_HEADER_NAMES 全列;hook 时机 fire-and-forget、tee() 分叉不影响 client 延迟;/api/mock 回放仅 NODE_ENV !== production 生效。同时纠正 .env.example 注释里 tests/fixtures 与源码实际默认 data/traffic-recordings 的不一致。 - troubleshooting:按客户端 Key / 路由 / SSE / CLIProxyAPI / 计费 / 日志 六类组织 symptom→error code→源码定位→排查方向表格。覆盖 API_KEY_MODEL_NOT_ALLOWED、NO_AUTHORIZED_UPSTREAMS、NO_HEALTHY_CANDIDATES、 CONCURRENCY_FULL、QUEUE_WAIT_TIMEOUT、CLIENT_DISCONNECTED、queue_full、 REQUEST_TIMEOUT、STREAM_ERROR、CliproxyConnectionStatus 四态、 CliproxyInstanceInUseError、duration_ms 24.8 天、status_code=520、 UnbillableReason 四类等,并明确划分与部署侧 troubleshooting / circuit breaker 长篇 / cliproxy 长篇的边界,避免主题重叠。 Phase 2 使用侧 6/9 → 9/9,剩部署 0/6、架构 0/9。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 2 使用侧收尾 3 篇,至此使用指南 9/9 全部完成。
docs/guide/usage/logs-stats.md— 请求日志与统计request_logs40+ 列分组列出,重点:duration_ms PR fix(billing): 识别 drizzle 包装后的 FK 违例,补齐 PR #169 漏掉的真实形状 #170/fix(request-logger): clamp duration_ms 到 INT4 上限,防止 reconcile 写入溢出 #171 的 INT4 clamp、stale reconcile 把 15 分钟未回填的 in-progress 行标 520。/api/admin/logs完整 query 参数集(注意无 model 过滤)、/api/admin/logs/liveSSE 的进程内 pub/sub 局限(多副本不跨实例)。LOG_RETENTION_DAYS当前没有任何后台清理任务消费、request_logs表实际无限增长,给出 SQL 手动清理兜底。docs/guide/usage/request-recording.md— 请求录制shouldRecordFixture只读 DB),默认enabled=false/mode=failure。{dir}/{provider}/{route}/{timestamp}.json+latest.json双写、16 MiB 截断、compactSSEChunks对 OpenAI Responses 大型快照事件的 instructions/tools 替换。SENSITIVE_HEADER_NAMES全列;hook 时机 fire-and-forget、tee()分叉不影响 client 延迟。/api/mock回放仅NODE_ENV !== production生效。.env.example注释里tests/fixtures与源码默认值data/traffic-recordings不一致,文档以源码为准并明确指出。docs/guide/usage/troubleshooting.md— 使用侧故障排查手册API_KEY_MODEL_NOT_ALLOWED/NO_AUTHORIZED_UPSTREAMS/NO_HEALTHY_CANDIDATES/CONCURRENCY_FULL/QUEUE_WAIT_TIMEOUT/CLIENT_DISCONNECTED/queue_full/REQUEST_TIMEOUT/STREAM_ERROR等。CliproxyInstanceInUseError、duration_ms24.8 天、status_code=520、UnbillableReason四类。troubleshooting/ circuit breaker 长篇 / cliproxy 长篇的边界明确划分,避免主题重叠。Phase 2 使用侧 6/9 → 9/9 全部合入,剩部署 0/6、架构 0/9。
Test plan
pnpm exec vitepress build docs本地通过,仅 env 语言无 highlighter 与 vueuse #PURE 注释告警,与本 PR 无关。