-
Notifications
You must be signed in to change notification settings - Fork 198
Claude SDK instrumentation #1618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deploying logfire-docs with
|
| 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 |
There was a problem hiding this 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.
Co-authored-by: Copilot <[email protected]>
Closes #1579