alibaba / alibaba/loongsuite-python

Bug Report: Get duplicated LLM spans in AgentScope applications

Open
#151 5 comments 0 reactions 1 assignee Claimed by @Cirilla-zmh View on GitHub
bug genai instrumentaion
Dominant language
Python
Stars
133
Forks
35
Avg merge
1d 12h
Merged PRs (30d)
5

Description

### Describe your environment

OS: MacOS
Python version: 3.12
Package version: 0.3.0.dev

### What happened?

We always get 4 LLM span for one react iteration. Just see:

Image

### Steps to Reproduce

1. Download source code of copaw: https://github.com/agentscope-ai/CoPaw
2. Instrument copaw with `loongsuite-python-agent`, just do:
a. clone `loongsuite-python-agent`
b. install instrumentation packages: `pip install loongsuite-python-agent/loongsuite-distro & pip install loongsuite-python-agent/util/opentelemetry-util-genai & pip install loongsuite-python-agent/instrumentation-loongsuite/loongsuite-instrumentation-agentscope`
c. do `from opentelemetry.instrumentation.auto_instrumentation import sitecustomize` before copaw is initialize
3. Start CoPaw following README: https://github.com/agentscope-ai/CoPaw?tab=readme-ov-file#quick-start
4. Ask CoPaw to complete a simple task with a tool, like "what's on my desktop".

### Expected Result

Only one LLM span should be record for each react iteration.

### Actual Result

You will gain a trace with duplicated LLM spans.

### Additional context

_No response_

### Would you like to implement a fix?

None

### Tip

[React](https://github.blog/news-insights/product-news/add-reactions-to-pull-requests-issues-and-comments/) 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](https://opentelemetry.io/community/end-user/issue-participation/).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.