You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no aggregated visibility into tool-call failures, token consumption, or session activity. The raw signals all exist — domain.ToolExecutionResult{Success, Duration, Error} is constructed in 137 places, per-request usage is captured, PricingService computes cost — but nothing collects them, so questions like "which tools fail most" or "tokens per model this week" are unanswerable.
Design
Recorder service in the container, delivered as a decorator around domain.ToolService.ExecuteTool — both execution paths funnel through it (chat internal/agent/agent.go:1021, headless cmd/agent.go:756). Records tool name, duration, outcome class (success / validation error / execution error / approval-rejected / timeout).
Token usage: tap the unified accumulator (see the accumulation-unification issue) — model, prompt/completion tokens, cost via the existing PricingService.
Sink, local-first: append JSONL under ~/.infer/metrics/ (rotate monthly), or the SQLite backend when configured. Never record prompt/response content — only counts, durations, model and tool names.
infer stats [--since 7d]: aggregate view — tool calls by name (count, failure rate, p50/p95 duration), tokens + cost by model, sessions by mode.
Config: metrics.enabled (default true, local-only), retention. Zero overhead when disabled (no-op recorder).
Acceptance criteria
Mock-gateway integration test: a scenario with a failing tool + the usage-report scenario → infer stats shows 1 failure and 142 tokens
infer stats renders cleanly on an empty store
Disabled mode adds no allocations on the tool path
Dependencies
Depends on #835 (single usage tap). Unblocks the OTLP exporter and the opt-in telemetry issues.
Activity
feat(telemetry): OpenTelemetry recorder, `infer stats`, and OTLP expo…
inference-gateway-releaser commentedon Jul 12, 2026
🎉 This issue has been resolved in version 0.145.0 🎉
The release is available on:
Your semantic-release bot 📦🚀