Multi-agent traces

Agents calling agents calling tools. Trefur reconstructs the full call graph — across processes, across languages — and renders it as a tree you can click through.

How attribution works

  • Every span carries a trace_id and a parent_run_id in line with the OpenTelemetry GenAI semantic conventions.
  • When an agent spawns a sub-agent (LangChain Agent, CrewAI delegate, Anthropic Task tool, Claude Agent SDK sub-agent dispatch), the SDK adapter detects the dispatch and propagates context into the child.
  • For cross-process spawns — say a parent emits a message to a queue and a worker picks it up — the SDK exposes parent_run_scope(...) (Python) and runInTraceContext(...) (JS) to thread the context across the boundary.

What you see

  • A span tree with parent + child runs, durations, and statuses.
  • Per-node activity summary — tokens, tools called, latency, error counts.
  • Cross-process trace continuation: the collector's OTel + LLM- proxy + MCP-proxy inputs carry traceparent headers through, so SDK-emitted parent runs stitch to collector-captured child calls automatically.

Agent-to-agent calls

When one of your agents calls another over HTTP, forward the W3C traceparent header on the outbound request. The receiving SDK reads it and attaches the child run to the parent, so the two runs share one trace — no server-side dispatch endpoint required.

Within a process, wrap the child work in runInTraceContext(...) (JS) or parent_run_scope(...) (Python); the SDK stamps the child's parent_run_id for you, so you don't have to thread identifiers by hand.

Session compaction + branching

Long-running agents periodically compact their context. Trefur captures the compaction event and lets you branch a new session from any prior checkpoint without losing trace continuity.