Anthropic agents boilerplate#4179
Merged
aabmass merged 21 commits intoopen-telemetry:mainfrom Feb 20, 2026
Merged
Conversation
- Introduced `opentelemetry-instrumentation-anthropic-agents` package for tracing LLM requests using the Anthropic Python SDK. - Added support for capturing request and response attributes in accordance with GenAI semantic conventions. - Included examples for both manual and zero-code instrumentation. - Created a CHANGELOG.md to document notable changes. - Added LICENSE and README files for package details and usage instructions. This commit lays the groundwork for enhanced observability in applications utilizing Anthropic's capabilities.
- Added support for the `opentelemetry-instrumentation-anthropic-agents` package, enabling tracing of requests made through the Claude Agent SDK. - Updated `pyproject.toml` and `tox.ini` to include new test environments and dependencies for the Anthropic Agents instrumentation. - Modified GitHub workflows to incorporate linting and testing for the new instrumentation. - Improved documentation in README files and examples to reflect changes in usage and setup. - Introduced new examples demonstrating both manual and zero-code instrumentation approaches. This commit strengthens observability for applications utilizing Claude Agents, ensuring comprehensive tracing and logging capabilities.
…mentation, streamlining the document to reflect current features and improvements.
- Changed dependency from `anthropic >= 0.16.0` to `claude-agent-sdk >= 0.1.14` in `README.md`, `pyproject.toml`, and related files. - Refactored `AnthropicAgentsInstrumentor` to align with the new SDK, including updates to initialization and logging. - Removed unused utility functions and cleaned up test configurations to reflect the new dependency. - Updated tests to ensure compatibility with the Claude Agent SDK. This commit enhances the instrumentation for applications using the Claude Agent SDK, ensuring accurate tracing and logging capabilities.
…ic Agents instrumentation - Updated `tox.ini` and `pyproject.toml` to require Python 3.10 or higher, removing support for Python 3.9. - Cleaned up GitHub workflows by removing outdated test jobs for Python 3.9 and adding new jobs for Python 3.10. - Updated `README.md` to reflect the new dependency on `claude-agent-sdk` and removed references to the old SDK. - Made minor code cleanups in example scripts and test files to improve readability. These changes ensure compatibility with the latest Python versions and streamline the testing process for the Anthropic Agents instrumentation.
da49290 to
bfa99a1
Compare
Kludex
reviewed
Feb 12, 2026
...trumentation-anthropic-agents/src/opentelemetry/instrumentation/anthropic_agents/__init__.py
Outdated
Show resolved
Hide resolved
Kludex
reviewed
Feb 12, 2026
...trumentation-claude-agent-sdk/src/opentelemetry/instrumentation/claude_agent_sdk/__init__.py
Show resolved
Hide resolved
wrisa
approved these changes
Feb 12, 2026
...strumentation-anthropic-agents/src/opentelemetry/instrumentation/anthropic_agents/version.py
Outdated
Show resolved
Hide resolved
MikeGoldsmith
approved these changes
Feb 16, 2026
Member
MikeGoldsmith
left a comment
There was a problem hiding this comment.
This looks good to me. I've left one small request to add issues to track the follow-up work.
...trumentation-claude-agent-sdk/src/opentelemetry/instrumentation/claude_agent_sdk/__init__.py
Show resolved
Hide resolved
aabmass
reviewed
Feb 17, 2026
instrumentation-genai/opentelemetry-instrumentation-anthropic-agents/pyproject.toml
Outdated
Show resolved
Hide resolved
instrumentation-genai/opentelemetry-instrumentation-claude-agent-sdk/pyproject.toml
Show resolved
Hide resolved
…ting references in configuration files, workflows, and documentation. Add new files for the Claude Agent SDK instrumentation, including README, examples, and changelog. Ensure proper setup for testing and linting in CI/CD workflows.
…tion for Anthropic and Claude Agent SDK.
…t SDK instrumentation
emdneto
reviewed
Feb 19, 2026
...mentation-genai/opentelemetry-instrumentation-claude-agent-sdk/tests/requirements.latest.txt
Show resolved
Hide resolved
aabmass
approved these changes
Feb 19, 2026
...mentation-genai/opentelemetry-instrumentation-claude-agent-sdk/tests/requirements.latest.txt
Show resolved
Hide resolved
…ts-boilerplate Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # .github/workflows/test_0.yml # .github/workflows/test_1.yml # .github/workflows/test_2.yml # uv.lock
emdneto
approved these changes
Feb 20, 2026
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.
Description
This PR adds boilerplate instrumentation for the Anthropic Agents SDK, establishing the scaffolding to capture spans/metrics/logs around agent calls and providing a starting point for future telemetry enhancements. This PR is shamelessly inspired from this PR.
Motivation: enable consistent GenAI observability for Claude Agents workflows and align instrumentation shape with other GenAI integrations.
Dependencies: claude-agent-sdk (minimum supported version per package metadata).
Callouts: Claude-agent-sdk requires is compatible with python version >= 3.10
Fixes #4065 partly
P.S: LLM help was used for writing the code.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Basic testing has been added as full functionality is still not implemented.
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md (https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/CONTRIBUTING.md) for styleguide, changelog guidelines, and more.