Summary
inference-gateway/cli#908 (closes inference-gateway/cli#903) adds a local span-tree viewer for the traces recorded by inference-gateway/cli#901: a new infer traces command and a /traces chat shortcut. Both are undocumented.
User-facing behavior to document:
infer traces [session-id] - renders the span tree of a session (session root -> LLM turns -> tool calls) with per-span durations, read from the local per-session trace file under ~/.infer/telemetry/<session>-traces.jsonl. With no argument it picks the most recent session.
infer traces --list - enumerates sessions that have trace files.
infer traces --format json - emits the tree as structured output (span names, start times, durations in fractional milliseconds, attributes, children).
/traces [session-id] - the same view as a chat shortcut, mirroring the infer stats / /stats pairing.
- Spans with error status or an
error.type attribute are marked with [error: <type>].
- Works fully offline from local files; no OTLP collector required; requires
telemetry.enabled: true for traces to be recorded in the first place.
Example output:
session (standard, success) 38.8s
|-- chat ollama_cloud/deepseek-v4-flash 3.4s
|-- execute_tool Read 162us
`-- chat ollama_cloud/deepseek-v4-flash 8.1s
Affected pages:
- CLI command reference: add
infer traces alongside infer stats.
- Chat shortcuts page: add
/traces alongside /stats.
- Telemetry/observability page (if present): mention the local trace files and the viewer.
Source: inference-gateway/cli#908, inference-gateway/cli#903.
Acceptance Criteria
Summary
inference-gateway/cli#908 (closes inference-gateway/cli#903) adds a local span-tree viewer for the traces recorded by inference-gateway/cli#901: a new
infer tracescommand and a/traceschat shortcut. Both are undocumented.User-facing behavior to document:
infer traces [session-id]- renders the span tree of a session (session root -> LLM turns -> tool calls) with per-span durations, read from the local per-session trace file under~/.infer/telemetry/<session>-traces.jsonl. With no argument it picks the most recent session.infer traces --list- enumerates sessions that have trace files.infer traces --format json- emits the tree as structured output (span names, start times, durations in fractional milliseconds, attributes, children)./traces [session-id]- the same view as a chat shortcut, mirroring theinfer stats//statspairing.error.typeattribute are marked with[error: <type>].telemetry.enabled: truefor traces to be recorded in the first place.Example output:
Affected pages:
infer tracesalongsideinfer stats./tracesalongside/stats.Source: inference-gateway/cli#908, inference-gateway/cli#903.
Acceptance Criteria
infer traces(including--listand--format json) is documented in the CLI command reference with an example span tree./tracesis documented on the chat shortcuts page.infer traces.