traces¶
AdalFlow traces module with OpenAI Agents SDK compatible interface.
This module provides trace implementations for AdalFlow tracing that follow the OpenAI Agents SDK patterns for maximum compatibility with existing observability backends.
References: - OpenAI Agents SDK: https://github.com/openai/openai-agents-python/blob/main/src/agents/tracing/traces.py
- class Trace[source]¶
Bases:
object
A trace is the root level object that tracing creates. It represents a logical “workflow”.
- abstract start(mark_as_current: bool = False)[source]¶
Start the trace.
- Parameters:
mark_as_current – If true, the trace will be marked as the current trace.
- abstract finish(reset_current: bool = False)[source]¶
Finish the trace.
- Parameters:
reset_current – If true, the trace will be reset as the current trace.
- abstract property trace_id: str¶
The trace ID.
- abstract property name: str¶
The name of the workflow being traced.
- class NoOpTrace[source]¶
Bases:
Trace
A no-op trace that will not be recorded.
- start(mark_as_current: bool = False)[source]¶
Start the trace.
- Parameters:
mark_as_current – If true, the trace will be marked as the current trace.
- finish(reset_current: bool = False)[source]¶
Finish the trace.
- Parameters:
reset_current – If true, the trace will be reset as the current trace.
- property trace_id: str¶
The trace ID.
- property name: str¶
The name of the workflow being traced.
- class TraceImpl(name: str, trace_id: str | None, group_id: str | None, metadata: Dict[str, Any] | None, processor: TracingProcessor)[source]¶
Bases:
Trace
A trace that will be recorded by the tracing library.
- group_id¶
- metadata¶
- property trace_id: str¶
The trace ID.
- property name: str¶
The name of the workflow being traced.
- start(mark_as_current: bool = False)[source]¶
Start the trace.
- Parameters:
mark_as_current – If true, the trace will be marked as the current trace.