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
{{ message }}
Repository navigation
feat: Add Claude Code telemetry to a recorded session: tool times, permission waits, call labels, retries #1924
The proxy sees the wire but not what happens on the client between calls:
Tool time is inferred from the response that asked for the tools to the
next request (timeline.go:126). Parallel tools all get the same window:
on one real session, 3 parallel tools each showed 9.8 s, though they took
5.9, 1.4 and 4.5 s.
Permission waits are not visible at all.
Side calls (session title, prompt suggestion, away summary) show as main.
Retries are separate rows that can't be told apart from new calls: X-Stainless-Retry-Count was 0 on all 59 rows of a session with retries,
because Claude Code retries outside the SDK counter.
Claude Code's own OpenTelemetry has all four: tool and tool.execution
spans, tool.blocked_on_user (permission waits), query_source (main,
subagent, side call) and attempt.
Proposal
Join the telemetry to the recorded session. Session id is the same on both
sides (X-Claude-Code-Session-Id = the spans' session.id). Tool spans
join exactly by tool_use id, which matched on 42 of 42 tools in our test.
Model-call spans join by session id plus start order and time, because
Claude Code sends no traceparent.
For the export-time join, where do the spans come from? Claude Code exports
OTLP to a collector, not to a file. Options: a local file sink outside the
proxy, or an existing collector.
Activity