> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# handler

## GalileoTracingProcessor

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).

### add\_galileo\_custom\_span

```python theme={null}
def add_galileo_custom_span(span: GalileoSpan) -> Span[GalileoCustomSpan]
```

Add a Galileo custom span to the trace.

### force\_flush

```python theme={null}
def force_flush(self) -> None
```

Forces an immediate flush of all queued traces/spans.

### on\_span\_end

```python theme={null}
def on_span_end(self, span: Span[Any]) -> None
```

Called when an OpenAI Agent span ends.

### on\_span\_start

```python theme={null}
def on_span_start(self, span: Span[Any]) -> None
```

Called when an OpenAI Agent span starts.

### on\_trace\_end

```python theme={null}
def on_trace_end(self, trace: Trace) -> None
```

Called when an OpenAI Agent trace ends.

### on\_trace\_start

```python theme={null}
def on_trace_start(self, trace: Trace) -> None
```

Called when an OpenAI Agent trace starts.

### shutdown

```python theme={null}
def shutdown(self) -> None
```

Called when the application stops. Flushes any remaining logs.
