skillfed

openinference-instrumentation-claude-agent-sdk

OpenInference Claude Agent SDK Instrumentation

openinference-instrumentation-claude-agent-sdk v0.1.10 432.5K downloads/30d#6,707 on PyPI1,147
Permissive license Apache-2.0 Active released

What it is and what it does

This package wraps Claude Agent SDK calls (query() and ClaudeSDKClient) with OpenTelemetry instrumentation to emit traces compatible with OpenInference conventions. Each call generates an AGENT span containing the prompt input, result output, session and model metadata, token counts, and nested TOOL spans for any tool invocations. Traces are sent to an OTLP collector—Phoenix (local or cloud), Arize AX, or any standard OpenTelemetry backend—enabling observability of agent behavior, tool usage, and LLM costs.

The package uses hook injection into the Claude Agent SDK to capture tool execution (PreToolUse, PostToolUse, PostToolUseFailure events) without modifying application code beyond a single instrumentation call. It depends on openinference-instrumentation, opentelemetry-api, opentelemetry-instrumentation, and related semantic convention packages. For deeper visibility into internal Anthropic API calls within the agent, pair it with openinference-instrumentation-anthropic.

Use it for:

  • Monitor agent query latency, token usage, and cost per call in production.
  • Debug multi-turn conversations by viewing the full trace of prompts, responses, and tool calls.
  • Analyze tool invocation patterns and failure rates across agent runs.
  • Export traces to Phoenix Cloud or Arize AX for centralized LLM observability dashboards.
  • Correlate agent spans with downstream application metrics in a unified OpenTelemetry backend.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Auto-instruments Claude Agent SDK calls to emit OpenTelemetry-compatible traces capturing prompts, results, token counts, and tool execution as OpenInference AGENT spans.

Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and directly solves a concrete problem—observing Claude Agent SDK behavior in production. Install it if you run Claude agents and need traces for debugging, monitoring, or cost analysis. Pair it with openinference-instrumentation-anthropic if you also need visibility into the underlying Anthropic API calls.

Install

openinference-instrumentation-claude-agent-sdk on PyPI

pip

pip install openinference-instrumentation-claude-agent-sdk

uv

uv add openinference-instrumentation-claude-agent-sdk

poetry

poetry add openinference-instrumentation-claude-agent-sdk

Installing openinference-instrumentation-claude-agent-sdk

Before you install

Low friction: pure Python wheel with standard OpenTelemetry dependencies. Actively maintained (released 2026-08-12, last commit 2026-08-14) with no known vulnerabilities.

License in practice

Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions.

Quickstart

pip install openinference-instrumentation-claude-agent-sdk

from openinference.instrumentation.claude_agent_sdk import ClaudeAgentSDKInstrumentor
from opentelemetry.sdk import trace as trace_sdk
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace.export import SimpleSpanProcessor

tracer_provider = trace_sdk.TracerProvider()
tracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint)))
ClaudeAgentSDKInstrumentor().instrument(tracer_provider=tracer_provider)

Requires Claude Agent SDK and an OTLP collector endpoint (local Phoenix, Phoenix Cloud, or Arize AX) to send traces.

Verify before relying

  • Whether traces from query() and ClaudeSDKClient.receive_response() are automatically correlated across multi-turn conversations.
  • Performance overhead of hook-based instrumentation on high-frequency tool calls.
  • Whether tool span context is preserved when using openinference-instrumentation-anthropic alongside this package.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (<3.15,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 7 — openinference-instrumentation, openinference-semantic-conventions, opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions, typing-extensions, wrapt
Maintenance actively maintained — 2 days since the last release
Last repo commit
First released
Downloads 432,529/month — #6,707 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: openinference_instrumentation_claude_agent_sdk-0.1.10-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

claude agent sdk tracingopentelemetry instrumentation claudellm observability agent spansclaude sdk monitoringopeninference agent tracinganthropic agent instrumentationllm trace collection
llm-observabilityopentelemetryagent-tracing

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

lmnr-claude-code-proxy

A thin proxy server that routes Claude Code…

unclear · top 5,000 on PyPI

openinference-instrumentation-agno

Auto-instruments Agno Agent applications to…

permissive · top 15,000 on PyPI

openinference-instrumentation-openai

Auto-instruments OpenAI Python SDK calls to…

permissive · top 5,000 on PyPI

openinference-instrumentation-google-adk

Auto-instruments Google ADK applications to…

permissive · top 15,000 on PyPI

openinference-instrumentation-google-genai

Automatically instruments Google GenAI SDK…

permissive · top 15,000 on PyPI

openinference-instrumentation-mcp

Auto-instruments MCP tool calls to propagate…

permissive · top 15,000 on PyPI

claude-agent-sdk

Python SDK for building and interacting with…

permissive · top 1,000 on PyPI

openinference-instrumentation-openai-agents

Auto-instruments OpenAI Agents SDK to emit…

permissive · top 5,000 on PyPI

openinference-semantic-conventions

Defines semantic conventions and standardized…

permissive · top 5,000 on PyPI

claude-code-sdk

Python SDK for querying Claude Code and…

permissive · top 15,000 on PyPI

Further reading