open-telemetry / open-telemetry/opentelemetry-python-contrib

No support for Async messages when using Anthropic instrumentation

Open
#4,497 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

Describe your environment

OS: Mac OS
Python version: Python 3.14.0
Package version: @main

What happened?

There is no support for async messages when instrumenting Anthropic ChatAnthropic, so no spans are created.

Steps to Reproduce

Create a simple example like this one using FastAPI async : https://github.com/salaboy/observing-ai/tree/main/python/langchain/python-merch-store-otel-langchain-official

Expected Result

Async message should be instrumented as Sync messages

Actual Result

No instrumentation happens if Async is used.

Additional context

No response

Would you like to implement a fix?

Yes

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the FastAPI async example linked in the issue and trace its use of Anthropic ChatAnthropic instrumentation. Compare the async message path with the existing synchronous path, then verify that async messages produce spans in the reproduction example.

Written by the indexing model from the issue text.

Assessment

Tech stack
fastapi, python
Domain
backend, observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.