Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Confident ai Deepeval DeepEvalTracingProcessor

From Leeroopedia
Metadata
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

  • TracingProcessor from agents.tracing

I/O Contract

Inputs (Constructor Parameters)

Input Contract
Name Type Default Description
(none) -- -- The DeepEvalTracingProcessor takes no constructor parameters. All configuration is handled via the span events received at runtime.

Outputs

Output Contract
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 processor is registered via RunConfig's tracing_processors parameter.
  • During execution, the processor receives span start/end events for all agent operations.
  • The captured trace is available for evaluation after the run completes.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment