ADORSYS-GIS / ADORSYS-GIS/lightbridge-authz

[Epic]: Usage graphs end to end

オープン
#508 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
epic
主要言語
Rust
スター
0
フォーク
1
平均マージ
6時間 42分
マージ済み PR(30日)
246

説明

### Executive Summary
We want the console Overview to show real usage, because today it shows nothing and `packages/api-rest` has zero importers anywhere in the repo. This epic exists so operators can see consumption instead of guessing at it.

### Strategic Intent
Turn the Overview from a scaffold into a real answer to 'what is this account actually consuming'.

### Problem Statement
Three independent blockers, in order of weight: (1) there is no query client wired at all - `use-overview-screen.ts` says so in its own comment; (2) the usage query listener requires mTLS on port 3006 and the Next proxy presents no client certificate; (3) `usage_events` is empty locally, so even a wired chart would render nothing.

### Desired Outcome
The Overview renders real usage from `/usage/v1/usage/query`, or an honest inline unavailable state - never an empty chart that reads as zero.

### Scope (In / Out)
**In:**
- A real query client on the console Overview
- Client-certificate identity for the Next usage proxy
- Local usage-event seeding
- Honest unavailable states

**Out:**
- Changing the usage service's mTLS posture (#347 is deliberate)
- New chart types beyond what the Overview already specifies

### Source of truth (links)
- `apps/console/src/containers/use-overview-screen.ts` (scaffold comment)
- `apps/console/src/app/api/usage/[...path]/route.ts` (503 path)
- `docs/usage-api.md`, #347 (split TLS surface)

### Stakeholders
Platform team (4 advanced + 2 senior engineers), Scrum Master, prod operators.

### Key Assumptions
- The console keeps proxying through its Next server rather than calling the usage service from the browser
- The existing `authz-tls` cert carries `clientAuth`, so no new CA is needed

### Constraints
- An empty chart must never be presented as zero usage
- Every new or changed file under `src/` stays at or below 200 LoC; single-responsibility modules (SOLID); no copy-pasted logic (DRY).

### Risks
- Cost figures have been wrong by a factor of 10^6 in this domain before; verify units end to end before trusting any rendered number
- `usage_events` was never actually a hypertable - do not assume Timescale continuous aggregates exist

### Success metrics
- The Overview renders a non-empty chart against seeded local data
- With `USAGE_URL` unset, every panel shows an explicit unavailable state
- No panel can render 0 when the true answer is unknown

### Child User Stories
Tracked as sub-issues of this epic.

### Human accountable owner
@stephane-segning

### AI Usage Declaration
Epic decomposition and estimation were AI-assisted.
Structure and estimates drafted with AI from a verified repository audit (file
line counts, config keys, and dependency state were read from the actual tree,
not assumed). A human owns intent, scope, and the release commitment.

### Human verification completed
- [ ] I can explain this work without referring to the AI-generated text
- [ ] Acceptance criteria are testable
- [ ] Source of truth is a real link, not boilerplate

Governance: https://adorsys-gis.github.io/ai-governance/

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。