Skip to content

Conversation

@alexmojaki
Copy link
Contributor

Closes #1579

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 9, 2026

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: c969dba
Status: ✅  Deploy successful!
Preview URL: https://0527d775.logfire-docs.pages.dev
Branch Preview URL: https://alex-claude-sdk.logfire-docs.pages.dev

View logs

@alexmojaki alexmojaki requested a review from Copilot January 12, 2026 13:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for instrumenting the Claude Agent SDK via Langsmith OpenTelemetry tracing. The implementation reuses existing LangSmith span transformation logic to work with Claude Agent SDK spans.

Changes:

  • Added comprehensive documentation for Claude Agent SDK integration with example code
  • Extended span transformation logic to handle Claude Agent SDK's message format (system/prompt patterns)
  • Added test coverage validating the span attribute transformation
  • Updated navigation and UI documentation to include Claude Agent SDK

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/integrations/llms/claude-agent-sdk.md New documentation page with setup instructions and example usage
tests/otel_integrations/test_claude_sdk.py Test file validating span transformation for Claude Agent SDK spans
logfire/_internal/exporters/processor_wrapper.py Extended span transformation to handle system/prompt input format and tool message ID mapping
logfire/_internal/scrubbing.py Added langsmith session attributes to scrubbing whitelist
mkdocs.yml Added Claude Agent SDK to navigation (plus incidental formatting changes)
docs/integrations/llms/langchain.md Updated to include LANGSMITH_OTEL_ONLY environment variable
docs/integrations/llms/anthropic.md Added note distinguishing from Claude Agent SDK
docs/guides/web-ui/llm-panels.md Added Claude Agent SDK to compatibility table
tests/otel_integrations/test_langchain.py Added LANGSMITH_OTEL_ONLY environment variable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alexmojaki alexmojaki enabled auto-merge (squash) January 12, 2026 14:09
@alexmojaki alexmojaki merged commit e7b89a6 into main Jan 12, 2026
13 checks passed
@alexmojaki alexmojaki deleted the alex/claude-sdk branch January 12, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Instrumenting claude-agent-sdk in logfire

2 participants