feat(http): `/metrics` 无一个 label、无一个直方图、无成本维度——5xx 率算不出、模型烧钱看不见、BudgetExceeded 记成 success
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- observability
Research direction
Start from the Metrics struct at src/http/mod.rs:63-86 — thirteen bare AtomicU64s with no label carrier — and the hard-coded exposition at handlers.rs:1835-1878. Read the metrics middleware in rate_limit.rs:178-188, which only does fetch_add and never reads status or timing, then the /run path at handlers.rs:319-337 where BudgetExceeded is recorded as success. Done means /metrics exposes route/status/model/finish_reason labels, a cost counter and three histograms, and /run reports failure per finish_reason.
Written by the indexing model from the issue text.
Description
场景 gap 单(okguitar 提报)· 优先级 P1 · 依赖:无 · 验收:代码 diff 逐点核对;运行时可见性另需 Langfuse(#124)
基线 origin/main = fc29f3d4。
Summary
src/http/mod.rs:63-86:Metrics为 13 个裸AtomicU64(requests_total/active、agent_runs_、tokens_、sessions_active、rate_limits_rejected、runs_waiting/in_flight)——无 label 载体;handlers.rs:1835-1878exposition 为硬编码纯数字;rate_limit.rs:178-188的 metrics_middleware 只 fetch_add,不读 status、不计时。- 关键词缺失:①
requests_total无 status/route label → 5xx/503(准入打满)率根本不存在;② 无 model label、无cost_usd指标;③ 无直方图(llm_latency_ms在RuntimeOutcome里有产出,HTTP 层从不消费——handlers.rs:1238写 0);④FinishReason8 变体无一进指标:/run对 BudgetExceeded 也record_run_success+ 返回"status":"success"(handlers.rs:319-337);⑤ 无 compaction/重试/工具错误计数。
建议
引入 labels(route/status/model/finish_reason)+ recursive_cost_usd_total + 3 个直方图(LLM 延迟、admission 等待、run 步数);/run 的 status 字段按 finish_reason 区分。
- Dominant language
- Rust
- Stars
- 4
- Forks
- 0
- Avg merge
- 5h 32m
- Merged PRs (30d)
- 7
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jeffkit/recursive
-
Difficulty 3/5 Half a day Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
jeffkit/recursive#141 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
jeffkit/recursive#138 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
jeffkit/recursive#134 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Maintainers usually reply within 1 day
All issues in jeffkit/recursive
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Update dusk-bls12_381 to 0.16Possibly taken @HDauven claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
`TcpListenerService` shares one `Extensions` store across all accepted connectionsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googlefonts/fontquant#43 ·