mirror of
https://github.com/langchain-ai/langsmith-docs.git
synced 2026-08-26 17:26:32 -04:00
DOC: <Issue related to /observability/how_to_guides/trace_with_openai_agents_sdk> #88
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dast-draftwise on GitHub (Aug 18, 2025).
Originally assigned to: @angus-langchain on GitHub.
This approach doesnt track tool costs.

I have a simple tool responsible for making a string into lowercase using LLM as well as an triage Agent responsible for picking up the right tool for the task, in this case there is only one tool. I run the code with the
OpenAIAgentsTracingProcessordefined.This approach works well, the issue is that it created in the LangSmith UI a separate trace for the Agent vs Tool calls (LLM)
How can I have the agent and tool call under the same trace?
@angus-langchain commented on GitHub (Aug 18, 2025):
@dast-draftwise Currently the OpenAIAgentsTracingProcessor() doesn't work alongside other tracing methods, meaning you can't trace agents sdk and custom LangSmith/LangChain spans in the same trace.
@dast-draftwise commented on GitHub (Aug 18, 2025):
Is there any plan to support that, or at least add more configuration options to it?
Its extremely not configurable, which makes it hard to integrate with other tools.
@angus-langchain commented on GitHub (Aug 19, 2025):
I could support having the integration inherit langsmith context if available, but that would only work unidirectionally. Meaning openai agents could be parented by a langsmith span, but not vice versa. Would that help?
@dast-draftwise commented on GitHub (Aug 19, 2025):
Would that preserve the order of the spans within the trace and place them under one trace? - if yes, that would help - if no, than probably nope.
Given my example, which I think quite well demonstrates the integration - do you know how to add efficiently metadata?
I added @traceable(metadata={}) to the agent
run_smart_text_agentbut it doesnt set the metadata in the langsmith . Given that the spans cant be placed under same trace, I am trying to add a metadata to each of the spans (agent, tool) which they share, and can be filtered by.@angus-langchain commented on GitHub (Aug 19, 2025):
I saw you opened a duplicate issue on our forum, I will continue the conversation there
https://forum.langchain.com/t/openai-agent-sdk-langsmith-integration/1254/2