GalileoTracingProcessor Objects

class GalileoTracingProcessor(TracingProcessor, DecorateAllMethods)

OpenAI Agents TracingProcessor for logging traces to Galileo.

Builds a tree of spans during agent execution and logs them hierarchically to Galileo upon trace completion.

Arguments:

  • _galileo_logger (GalileoLogger): The Galileo logger instance.
  • _flush_on_trace_end (bool): Whether to automatically flush the log batch to Galileo when a trace ends.
  • _nodes (dict[str, Node]): Stores Node objects keyed by their OpenAI span_id or trace_id (for root).

on_trace_start

def on_trace_start(trace: Trace) -> None

Called when an OpenAI Agent trace starts.

on_trace_end

def on_trace_end(trace: Trace) -> None

Called when an OpenAI Agent trace ends.

on_span_start

def on_span_start(span: Span[Any]) -> None

Called when an OpenAI Agent span starts.

on_span_end

def on_span_end(span: Span[Any]) -> None

Called when an OpenAI Agent span ends.

shutdown

def shutdown() -> None

Called when the application stops. Flushes any remaining logs.

force_flush

def force_flush() -> None

Forces an immediate flush of all queued traces/spans.