--- id: opentelemetry-instrumentation-anthropic version: "0.62.3" license: Apache-2.0 license_treatment: permissive maintenance: active --- # opentelemetry-instrumentation-anthropic — OpenTelemetry Anthropic instrumentation License: permissive · Maintenance: active · Downloads: 4.8M/mo ## What it is and what it does This package integrates the Anthropic Python SDK with OpenTelemetry, automatically capturing LLM interactions as distributed traces. When you call the Anthropic API through your instrumented code, the library records prompts, completions, and metadata as span attributes, giving you visibility into what your LLM application is doing without code changes beyond a single instrument() call. By default it logs all content to spans, which aids debugging and quality evaluation but may expose sensitive user data. You can disable content logging via the TRACELOOP_TRACE_CONTENT environment variable to reduce trace size and privacy risk. The package depends on opentelemetry-api, opentelemetry-instrumentation, and two semantic-conventions packages to define standard attribute names for AI workloads. Use it for: - Debug LLM application behavior by inspecting actual prompts and completions sent to Anthropic in your traces. - Monitor token usage and latency of Anthropic API calls in production via OpenTelemetry exporters. - Evaluate output quality by correlating trace data with application metrics and user feedback. - Reduce trace verbosity in privacy-sensitive deployments by disabling content logging while keeping call metadata. - Integrate Anthropic observability into existing OpenTelemetry pipelines without custom instrumentation code. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds OpenTelemetry tracing to Anthropic API calls, capturing prompts, completions, and request/response metadata as span attributes for observability and debugging. Yes, if you use Anthropic and already run OpenTelemetry. The instrumentation is actively maintained, has no known vulnerabilities, and requires only a permissive license. Install it to add LLM tracing to your observability stack with minimal setup. Skip it if you don't use Anthropic or have no OpenTelemetry backend configured. ## Install pip install opentelemetry-instrumentation-anthropic uv add opentelemetry-instrumentation-anthropic poetry add opentelemetry-instrumentation-anthropic ## Installing opentelemetry-instrumentation-anthropic Before you install: Low friction installation with four runtime dependencies on stable OpenTelemetry packages. Actively maintained with a recent release (4 days old) and no known vulnerabilities. License in practice: Licensed under Apache-2.0 (permissive), allowing use in both open-source and commercial projects with minimal restrictions. Quickstart: pip install opentelemetry-instrumentation-anthropic from opentelemetry.instrumentation.anthropic import AnthropicInstrumentor AnthropicInstrumentor().instrument() Requires Python 3.10 or later; requires an active OpenTelemetry SDK and exporter configured separately to send traces to a backend. Verify before relying: - Whether this instrumentation works with all Anthropic SDK versions or has specific compatibility constraints. - Performance overhead of tracing on typical Anthropic API call latency. - Whether TRACELOOP_TRACE_CONTENT environment variable is the only privacy control available. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 4.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags opentelemetry anthropic tracing, llm instrumentation anthropic, trace anthropic api calls, observability anthropic sdk, anthropic span attributes, llm monitoring instrumentation, observability, llm-tracing, anthropic [View on SkillFed](https://skillfed.io/packages/opentelemetry-instrumentation-anthropic) · [View on PyPI](https://pypi.org/project/opentelemetry-instrumentation-anthropic/)