Skip to content

feat(genai-anthropic): wrappers for async messages methods#4346

Merged
xrmx merged 15 commits into
open-telemetry:mainfrom
eternalcuriouslearner:feat/wrappers-for-async-messages-methods
Apr 7, 2026
Merged

feat(genai-anthropic): wrappers for async messages methods#4346
xrmx merged 15 commits into
open-telemetry:mainfrom
eternalcuriouslearner:feat/wrappers-for-async-messages-methods

Conversation

@eternalcuriouslearner

Copy link
Copy Markdown
Contributor

Description

This change adds sync and async wrappers for Anthropic message streams, keeps telemetry finalization in the wrapper layer, and adds tests for wrapper behavior. It does not wire the wrappers into instrumentation yet.

Fixes #3949 partly

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • python3 -m pytest -q instrumentation-genai/opentelemetry-instrumentation-anthropic/tests/test_async_wrappers.py
  • python3 -m pytest -q instrumentation-genai/opentelemetry-instrumentation-anthropic/tests/test_sync_messages.py
  • python3 -m pytest -q instrumentation-genai/opentelemetry-instrumentation-anthropic/tests/test_instrumentor.py

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@eternalcuriouslearner
eternalcuriouslearner requested a review from a team as a code owner March 18, 2026 22:54
@eternalcuriouslearner eternalcuriouslearner changed the title feat: wrappers for async messages methods feat(genai-anthropic): wrappers for async messages methods Mar 22, 2026
@xrmx xrmx moved this to Ready for review in Python PR digest Mar 23, 2026
@lzchen lzchen added the gen-ai Related to generative AI label Mar 26, 2026

@MikeGoldsmith MikeGoldsmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me 👍🏻

@xrmx
xrmx enabled auto-merge (squash) April 7, 2026 12:57
@xrmx
xrmx merged commit af11fc7 into open-telemetry:main Apr 7, 2026
861 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for review to Done in Python PR digest Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gen-ai Related to generative AI

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add OpenTelemetry instrumentation for the Anthropic Claude Python SDK

5 participants