Repository navigation
Conversation
Python now sends the Anthropic SDK's own OpenTelemetry spans (SDK 1.14.0 and later) to the register() provider, metadata-only by default, instead of installing traceAI-anthropic. Existing AnthropicInstrumentor users keep a section that creates clients with open_telemetry=False so each call is traced once. TypeScript is unchanged. Adds a regression check for the setup contract. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The native route now says that the session, user, metadata and tags set with using_session or using_attributes are not on the SDK's spans, and points readers who group traces by session or user to AnthropicInstrumentor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make the Anthropic SDK's native OpenTelemetry tracing the Python route, matching the Java guide (#1076), and keep existing
AnthropicInstrumentorusers on one tracing owner.anthropic>=1.14.0andfi-instrumentation-otelonly, and passes theregister()provider to the client withcontent_mode: "metadata_only". Changing it to"content"exports prompts and responses;TraceConfig/FI_HIDE_*and the session, user, metadata and tags set with context helpers (using_session,using_attributes) don't apply to the SDK's spans; readers who group traces by session or user are pointed to the instrumentor section.FI_HIDE_*).open_telemetry=Falseon SDK 1.14.0 and later so only the instrumentor records them; earlier SDKs don't accept the option.Every package the page installs is already published. The Python snippets were run as written against a loopback Anthropic stub and a loopback OTLP receiver with released
traceAI-anthropic0.1.12,anthropic2.3.0 andfi-instrumentation-otel1.2.2: the native route exports oneanthropic.messages.createspan to/tracer/v1/traces, and the instrumentor route exports oneMessagesspan.node --test scripts/integrations.test.mjs scripts/new-doc.test.mjspasses (19 tests; the new checks fail on the old page), and the page renders locally with the expected headings and anchor.Related traceAI change (when the SDK's span and the instrumentor's would reach the same provider, the instrumentor keeps its span and turns the SDK's off for that call): future-agi/traceAI#507. This page does not depend on it;
open_telemetry=Falsestays the recommended setup for instrumentor users on every released version.🤖 Generated with Claude Code