Implementation:Confident ai Deepeval DeepEvalTracingProcessor
| Knowledge Sources | |
|---|---|
| Domains | |
| Last Updated | 2026-02-14 09:00 GMT |
Overview
Concrete tracing processor class that integrates DeepEval with the OpenAI Agents SDK. The DeepEvalTracingProcessor class implements the TracingProcessor interface from the agents.tracing module and captures span lifecycle events during agent execution for evaluation purposes.
Description
The DeepEvalTracingProcessor is registered via RunConfig(tracing_processors=[processor]) when running an OpenAI agent. It receives on_span_start and on_span_end callbacks for every span in the execution, building a hierarchical trace that represents the full agent execution flow.
Key capabilities:
- Zero-configuration setup -- the processor takes no constructor parameters; it automatically captures all spans emitted during agent execution.
- Span lifecycle tracking -- receives both start and end events for each span, capturing timing, metadata, and results.
- Hierarchical trace construction -- reconstructs the full execution tree from individual span events, preserving parent-child relationships between agent steps, model calls, and tool invocations.
Usage
Import and register with the OpenAI Agents Runner:
from deepeval.openai_agents import DeepEvalTracingProcessor
Code Reference
Source Location
- Repository:
confident-ai/deepeval - File:
deepeval/openai_agents/callback_handler.py(lines 50--151)
Signature
class DeepEvalTracingProcessor(TracingProcessor):
def __init__(self):
...
Import
from deepeval.openai_agents import DeepEvalTracingProcessor
Parent Class
TracingProcessorfromagents.tracing
I/O Contract
Inputs (Constructor Parameters)
| Name | Type | Default | Description |
|---|---|---|---|
| (none) | -- | -- | The DeepEvalTracingProcessor takes no constructor parameters. All configuration is handled via the span events received at runtime.
|
Outputs
| Name | Type | Description |
|---|---|---|
| Trace | Internal trace object | Hierarchical trace of the OpenAI agent execution, constructed from span lifecycle events. |
Usage Examples
Example 1: Basic OpenAI Agent Instrumentation
Register the tracing processor with an OpenAI Agents Runner.
from deepeval.openai_agents import DeepEvalTracingProcessor
from agents import Agent, Runner, RunConfig
processor = DeepEvalTracingProcessor()
agent = Agent(name="my-agent", instructions="You are a helpful assistant.")
result = Runner.run_sync(
agent,
"Hello",
run_config=RunConfig(tracing_processors=[processor]),
)
- The
processoris registered viaRunConfig'stracing_processorsparameter. - During execution, the processor receives span start/end events for all agent operations.
- The captured trace is available for evaluation after the run completes.