Web Console: Model usage, token cost, latency, and workflow-performance analytics (Phase 4) #651

Open
opened 2026-07-10 14:42:32 -05:00 by jcwalker3 · 0 comments
Owner

Problem statement

There is no durable console analytics for model usage, token cost, latency, and workflow-stage performance correlated to issues/PRs/roles.

User and operational impact

Cannot optimize cost/latency or identify expensive failing stages; budget and performance conversations lack evidence.

Scope

  • Ingest or accept optional usage metrics from session instrumentation (when available).
  • Aggregate by project, role, model, issue/PR, stage.
  • Dashboards for cost, tokens, latency percentiles, stage duration.
  • Missing data must display as unknown, not zero-fabricated.

Explicit non-goals

  • No mandatory client-side telemetry that leaks prompts with secrets.
  • No billing integration with payment providers in this issue.
  • No automatic model routing changes without controller policy (#647).

Required implementation investigation

Session logs if any, #637 timeline, #650 insights, #631, privacy/redaction rules #633.

Proposed architecture or implementation direction

Metrics store (CP-DB or append-only files) with schema; aggregation API; charts simple server-rendered tables first.

Security and workflow-safety requirements

Redact prompts/secrets from metrics; RBAC; retention limits.

Acceptance criteria

  1. Schema for usage events documented.
  2. Aggregations by project/role/model/stage.
  3. Unknown data not shown as zero without label.
  4. Tests for aggregation and redaction.
  5. Docs for enabling instrumentation opt-in.

Required tests

Aggregation unit tests; privacy redaction tests.

Observability and audit requirements

Metrics pipeline health optional on system health (#634).

Dependencies and linkage

Canonical issue state

STATE: ready-for-author
WHO_IS_NEXT: author
NEXT_ACTION: Implement usage/cost/latency analytics schema + views
NEXT_PROMPT: Author analytics only; PR; stop

Required final evidence

PR with schema, API/views, tests, docs.

Required final response and handoff expectations

Brief PR → reviewer.

## Problem statement There is no durable console analytics for **model usage, token cost, latency, and workflow-stage performance** correlated to issues/PRs/roles. ## User and operational impact Cannot optimize cost/latency or identify expensive failing stages; budget and performance conversations lack evidence. ## Scope * Ingest or accept optional usage metrics from session instrumentation (when available). * Aggregate by project, role, model, issue/PR, stage. * Dashboards for cost, tokens, latency percentiles, stage duration. * Missing data must display as unknown, not zero-fabricated. ## Explicit non-goals * No mandatory client-side telemetry that leaks prompts with secrets. * No billing integration with payment providers in this issue. * No automatic model routing changes without controller policy (#647). ## Required implementation investigation Session logs if any, #637 timeline, #650 insights, #631, privacy/redaction rules #633. ## Proposed architecture or implementation direction Metrics store (CP-DB or append-only files) with schema; aggregation API; charts simple server-rendered tables first. ## Security and workflow-safety requirements Redact prompts/secrets from metrics; RBAC; retention limits. ## Acceptance criteria 1. Schema for usage events documented. 2. Aggregations by project/role/model/stage. 3. Unknown data not shown as zero without label. 4. Tests for aggregation and redaction. 5. Docs for enabling instrumentation opt-in. ## Required tests Aggregation unit tests; privacy redaction tests. ## Observability and audit requirements Metrics pipeline health optional on system health (#634). ## Dependencies and linkage * Parent: #631 · Soft-depends: #637, #633, #634 · Related: #650 ## Canonical issue state ```text STATE: ready-for-author WHO_IS_NEXT: author NEXT_ACTION: Implement usage/cost/latency analytics schema + views NEXT_PROMPT: Author analytics only; PR; stop ``` ## Required final evidence PR with schema, API/views, tests, docs. ## Required final response and handoff expectations Brief PR → reviewer.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#651