feat(FN-4388): complete remaining observability surfaces
Fusion-Task-Id: FN-4388 Fusion-Task-Lineage: 7497a0a1-5edb-4778-b339-118d1fd668f7
This commit is contained in:
@@ -367,6 +367,14 @@ The **Token Usage** panel in Agents view is derived from each agent's persisted
|
||||
- `totalInputTokens`
|
||||
- `totalOutputTokens`
|
||||
|
||||
### Cache-hit observability
|
||||
|
||||
Fusion exposes cache-hit metrics across logs, API, and CLI:
|
||||
|
||||
- **Structured logs:** `token-cache-metrics` channel emits per-persist records with `taskId`, `agentId`, `role`, `inputTokens`, `cachedTokens`, `cacheWriteTokens`, and computed `hitRatio`.
|
||||
- **Agent API:** `GET /api/agents/:id/token-usage` returns `last24h`, `last7d`, and `allTime` window summaries for permanent agents.
|
||||
- **CLI rollup:** run `pnpm fn:cache-stats` (or `pnpm fn:cache-stats --json`) for project-wide role totals plus per-permanent-agent cache-hit summaries.
|
||||
|
||||
For the current filtered/visible agent set, the panel shows:
|
||||
|
||||
- Aggregate input token total
|
||||
|
||||
Reference in New Issue
Block a user