Claude Agent SDK
Overview
respan-instrumentation-claude-agent-sdk enables the Claude Agent SDK’s native OpenTelemetry emission and normalizes the resulting spans into Respan conventions.
It registers an internal span processor before export, patches the upstream OpenTelemetry helpers for streamed Claude Agent SDK responses, and maps agent, model, tool, usage, cache-token, and cost attributes into the Respan OTLP pipeline.
Version: 0.1.0 | Python: >=3.11, <3.14
Dependencies
Quick start
Public API
ClaudeAgentSDKInstrumentor
Captured data
The plugin captures Claude Agent SDK agent invocations, streamed assistant output, tool definitions, tool calls, tool results, model names, usage tokens, cache-read/cache-creation tokens, and total cost when the upstream SDK provides it.
Content capture is controlled by capture_content. Set it to True when prompts, responses, and tool payloads should be visible in Respan.
Gateway
For a Respan-key-only runtime setup, see Claude Agent SDK gateway setup.