Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

feat(http): `/metrics` 无一个 label、无一个直方图、无成本维度——5xx 率算不出、模型烧钱看不见、BudgetExceeded 记成 success

Đang mở
#113 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
observability

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

场景 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-1878 exposition 为硬编码纯数字;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);④ FinishReason 8 变体无一进指标:/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 区分。

Ngôn ngữ chính
Rust
Star
4
Fork
0
Merge trung bình
5 giờ 32 phút
Pull request đã merge (30 ngày)
7

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của jeffkit/recursive

Tất cả issue của jeffkit/recursive

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.