Skip to content

[Epic] Observability & Metrics — open issues on stats, token usage, cost, hooks and telemetry #3271

Description

@Sayt-0

Several open issues in docker-agent address the same underlying need: being able to observe, measure and introspect what the agent does at runtime — token usage, LLM call costs, tool call stats, and lifecycle hook ordering. They were filed independently with no shared label and no common design connecting them.

This epic is the single reference to group them and drive a coherent solution.

Open issues in scope

Token usage & cost in hooks

Hook lifecycle & ordering

Run statistics & performance metrics

Tool call visibility & latency

Implementation order

  1. decide StreamStopped ordering vs session-end hooks and document teardown trade-offs from #3070 #3074 — Define teardown order — design decision and docs only, no large code change; unblocks reliable telemetry for everything that follows.
  2. Expose per-turn token usage and cost in the after_llm_call hook payload #2948 — Complete after_llm_call hook payload — add input_tokens, output_tokens, reasoning_tokens, cost_usd; small, self-contained, immediately useful for external tooling.
  3. Improve visibility of long-running / externally-blocked MCP tool calls #2079 — Live tool call status — show elapsed time and current status for in-flight MCP tool calls in the TUI and hook events; builds on the hook ordering defined in step 1.
  4. Stats on the usage along with performance + interaction summary ->success rate, tool calls etc #1345RunSummary structure — aggregate tokens, cost, tool call count, success/failure count, wall-clock duration into a structured end-of-session summary; builds on all three previous steps.

Metadata

Metadata

Assignees

Labels

area/agentFor work that has to do with the general agent loop/agentic features of the apparea/mcpMCP protocol, MCP tool servers, integrationarea/telemetryTelemetry, tracing, and metricsarea/toolsFor features/issues/fixes related to the usage of built-in and MCP toolsarea/tuiFor features/issues/fixes related to the TUI

Type

No fields configured for Epic.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions