Skip to content

[DOCS] Document infer traces command and /traces shortcut #390

Description

@edenreich

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

  • infer traces (including --list and --format json) is documented in the CLI command reference with an example span tree.
  • /traces is documented on the chat shortcuts page.
  • The telemetry docs mention that traces are recorded locally per session and can be viewed offline with infer traces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationreleased

    Type

    Fields

    No fields configured for Task.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions