#2639·agentscope

[Bug]: How to solve the OpenTelemetry conflict between Agentscope and AliyunJavaAgent

Author: six-teenCreated Sep 15, 2026Updated Sep 17, 2026

Prerequisites

  • I have searched the existing issues and discussions, and this is not a duplicate.
  • This is a bug, not a usage question. (For questions, please use Discussions instead.)

Background / Description

When I was upgrading agentscope to 2.0.0, I encountered a problem with trace reporting to my own "agent-studio" platform. Both the project and runs could see it, but only the trace page had no information about my project. After several days of troubleshooting, I found that the local environment was different from the server environment. The local debug mode started normally, but it did not work on the server. Later on, it was discovered that AliyunJavaAgent was introduced on the server through the "-javaagent" parameter. After removing it, everything returned to normal, but I have not yet found a way to make them compatible. What I expect is that with Aliyun JavaAgent connected normally, the trace of agentscope can also be reported to my own "agent-studio" normally.

"-Dotel.instrumentation.agentscope.enabled=false" After adding this parameter and having the AliyunJavaAgent probe, I did see the relevant information on the trace page, but then encountered a new problem. After clicking on the trace in agent studio to see the details, there was no expansion button that could be seen before, which was the button to expand the entire model call chain. I am very sure that this is a problem because I tried calling the same parameter in two situations. Without AliyunJavaAgent and the added parameters, the trace and expansion buttons were normal, and everything was normal. After adding AliyunJavaAgent and the "-Dotel. instrumentation.agentscope.enabled=false" parameter, there is only trace but no expand button in the details. I don't know if anyone else has encountered the same situation as me, and I don't know if the Agentscope official has any related processing for compatibility in the future. The general problem has also been analyzed, and the most important one is that Aliyun JavaAgent enhances the "io.agentscope.core.tracing.TracerRegistry#get" method, and only enhances the method exit (method return value). This will allow the agentscope framework to receive the Aliyun JavaAgent enhanced instance in all places where the method is called. I saw a document saying that Aliyun provides an Agentloop product that can collect corresponding traces, but this product may be charged? This has resulted in new cost expenses.

So ultimately, I hope to have a good solution that allows agentscope to customize its own OpenTelemetry to report traces.

I hope some experts can guide me on how to solve this problem, or if there is currently no solution, I hope the official version can handle this in future iterations.

Error Messages

bash
look Description

Steps to Reproduce

look Description

Environment

  • AgentScope Version:
  • Python Version:
  • OS:

Source: agentscope-ai/agentscope