Skip to content

Error while instrumenting openai-agents #542

@krmenda

Description

@krmenda

Hello,

I'm trying to use LangTrace (local deployment) with OpenAI Agents SDK.

Below is the code I ran:

from langtrace_python_sdk import langtrace
import agents

langtrace.init(
  api_key="sk-...",
  api_host="http://localhost:3000/api/trace",
)

The console output is:

Initializing Langtrace SDK..
⭐ Leave our github a star to stay on top of our updates - https://github.com/Scale3-Labs/langtrace
/Users/.../lib/python3.11/site-packages/langtrace_python_sdk/utils/__init__.py:94: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources
Skipping openai-agents due to error while instrumenting: type object 'Runner' has no attribute '_get_new_response'
Exporting spans to custom host: http://localhost:3000..

The versions of openai-agents and langtrace-python-sdk are:

openai-agents = {extras = ["langtrace"], version = "^0.1.0"}
langtrace-python-sdk = "^3.8.18"

Problem:

It looks like LangTrace is trying to instrument the openai-agents library but fails because Runner has no attribute _get_new_response.

Expected behavior:

Instrumenting the openai-agents module without error so spans can be captured.

Environment:

Python 3.11
Local LangTrace instance (http://localhost:3000)
MacOS (if relevant)

Thanks for your help!

Kunal

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions