ADORSYS-GIS / ADORSYS-GIS/lightbridge-authz

[Ticket]: usage query has no error/status signal for a request error-rate board

未关闭
#597 1 条评论 0 个 reaction 已指派 1 人 已被 @stephane-segning 认领 在 GitHub 查看
ticket
主要语言
Rust
星标
0
派生
1
平均合并
7 小时 7 分钟
30 天内合并 PR
237

描述

## Type

Feature

## Summary

`/admin/overview`'s "Request volume & errors" board (converse-frontends#368, the admin-area build) can only ever plot request volume: `UsageSeriesPoint` (`openapi/usage.backend.yaml`) carries no error/status signal at all — no `error_count`, no `status_code`, nothing an error-rate line could honestly be computed from. `signal_type`/`metric_name` are OTEL signal-kind fields (trace/metric/log), not outcome fields.

## Intent

The admin-overview design batch (`claude/sb-admin-dashboards`, page story `Pages/AdminOverview`) specified a requests-over-time board with an error-rate line, following the same shape a typical ops dashboard would want. The console's own honesty doctrine (ADR 0012 D8, "never fabricate a figure") means the live `/admin/overview` route cannot draw that second line — it renders request volume alone and captions the omission, citing this ticket.

## Source of truth

- converse-frontends#368 (epic: Console UI/UX revamp, phase "the admin area")
- `openapi/usage.backend.yaml`'s `UsageSeriesPoint` schema (no error/status property)
- `apps/console/src/containers/admin-overview-usage.ts`'s `requestVolumeSeries` (requests-only by design, this ticket is why)

## Current Behavior

- `UsageSeriesPoint` carries `requests`, `total_cost`, `usage_value`, token counts and latency percentiles — no field records whether a request succeeded, its HTTP/gRPC status, or any failure classification.
- There is consequently no way for the console (or any consumer of `/v1/usage/query`) to compute a real error rate from usage data today.

## Expected Behavior

- `UsageSeriesPoint` (or a sibling endpoint) carries a per-bucket error/failure count — e.g. `error_requests: i64` alongside the existing `requests` — populated from whatever outcome signal the ingest pipeline already has available (OTEL status codes on ingested spans, if that is the source), so a per-day error-rate line can be computed the same way `requests`/`total_cost` already are.
- If no outcome signal is captured anywhere in the ingest pipeline today, this ticket's resolution is to say so explicitly (a scope note here) rather than leave it open indefinitely — the frontend already degrades honestly either way (`admin-overview-usage.ts`'s `requestVolumeSeries`).

## Acceptance Criteria

- [ ] Either a new/extended field on `UsageSeriesPoint` (or documented equivalent) exposes a per-bucket error/failure count, OR this ticket is resolved as "no outcome signal exists to expose" with that decision recorded here.
- [ ] If a field is added: schema updated (`usage.backend.yaml`), a service-layer test asserting the count reflects real ingested failures, and `cargo test` green.
- [ ] Verification evidence is provided.

## Out of Scope

- Any change to `requests`/`total_cost`/other existing `UsageSeriesPoint` fields.
- The frontend wiring for the resulting error-rate line — a follow-up console ticket once this lands.

## Technical Context

- `openapi/usage.backend.yaml` (`UsageSeriesPoint`, `UsageQueryResponse`).
- `apps/console/src/containers/admin-overview-usage.ts` (`requestVolumeSeries`) and `apps/console/src/containers/use-admin-overview-screen.ts` (dashboard 6 wiring, the caption citing this ticket).

## Risks

- If genuinely out of scope for the ingest pipeline (e.g. no status signal is ever captured from the proxied requests), close as won't-fix with that decision recorded — the frontend already has an honest fallback either way.

## Test Plan

- Schema review + service-layer test for the new field, if added.
- `cargo test` in the affected crate(s).

## Verification evidence

Filed from the admin-area build (converse-frontends#368): traced through `openapi/usage.backend.yaml`'s `UsageSeriesPoint` schema and confirmed no error/status/outcome field exists on it, so `/admin/overview`'s "Request volume & errors" board can only honestly plot volume today.

## Human accountable owner

@stephane-segning

## AI Usage Declaration

- Understanding code
- Drafting the ticket

## Human verification completed

- [x] I understood the intent
- [x] I checked the source of truth
- [x] I reviewed all AI-generated text/code
- [ ] I am the accountable owner and accept responsibility for this ticket. (pending @stephane-segning's own sign-off — filed by an AI agent per converse-frontends#368's admin-area build, not yet human-reviewed)

贡献指南

打开贡献指南

调研方向

Start with openapi/usage.backend.yaml, focusing on UsageSeriesPoint and UsageQueryResponse, then trace the usage query service and ingest pipeline for an existing outcome signal. If a field can be added, update the schema, add the service-layer failure-count test, and run cargo test; otherwise record that no outcome signal exists. Done means verification evidence and one acceptance path are documented.

由索引模型根据 Issue 内容生成。

评估

技术栈
openapi, rust
领域
api, backend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。