Conversation
Greptile SummaryThis PR introduces per-request usage log visibility across the stack: two new backend endpoints ( Key changes:
Issues found:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as UsageLogsTable
participant API as Axum Router
participant Svc as UsageService
participant DB as UsageRepo (PG/SQLite)
UI->>API: GET /admin/v1/usage/logs?limit=50&cursor=...
API->>API: authz.require("usage","list")
API->>API: clamp limit (max 1000)
API->>Svc: list_logs(UsageLogQuery)
Svc->>DB: list_logs(query)
DB->>DB: build WHERE clause + cursor condition
DB->>DB: SELECT ... ORDER BY recorded_at DESC, id DESC LIMIT 51
DB-->>Svc: ListResult { items, has_more, cursors }
Svc-->>API: ListResult
API-->>UI: UsageLogListResponse { data[], pagination }
UI->>API: GET /admin/v1/usage/logs/export?format=csv
API->>API: authz.require("usage","list")
API->>Svc: list_logs(limit=10_000)
Svc->>DB: list_logs(query)
DB-->>Svc: ListResult (possibly truncated at 10k)
Svc-->>API: ListResult
API->>API: build_export_response(items, Csv|Jsonl)
API-->>UI: Content-Disposition: attachment (no truncation signal)
|
No description provided.