Skip to main content
The OpenAI Agents SDK uses has built in tracing to log agent runs, and this can be extended to log to platforms like Galileo. The Galileo Python SDK has a custom OpenAI tracing processor that logs all agent events, allowing you to evaluate your agentic apps using Galileo metrics.

Log an OpenAI Agent app

To log OpenAI Agent apps to Galileo, you need to create an instance of the GalileoTracingProcessor, and set this as the default tracing processor for your agent using the set_trace_processors function from the OpenAI Agents SDK.
from galileo.handlers.openai_agents import GalileoTracingProcessor
from agents import set_trace_processors

# Create a Galileo tracing processor
# and set it as the OpenAI tracing processor
set_trace_processors([GalileoTracingProcessor()])
Once this is set, all agent events, such as tool calls, handoffs, and generations, will be logged to Galileo. A graph of an agent call in Galileo showing guardrails and response generation A set of spans in Galileo showing an OpenAI Agent running guardrails, handoffs, and generating responses By default the tracing processor using the current logger at the time it is created. For example, if you create this processor in a function that is decorated with the @log wrapper, then the processor will log to the same logger. You can override this by passing a GalileoLogger into the GalileoTracingProcessor constructor.
from galileo import GalileoLogger
from galileo.handlers.openai_agents import GalileoTracingProcessor
from agents import set_trace_processors

# Create a logger
logger = GalileoLogger()

# Create a Galileo tracing processor using the existing logger
# and set it as the OpenAI tracing processor
set_trace_processors([GalileoTracingProcessor(galileo_logger=logger)])

Next steps