Processor interface
TracingProcessor
Bases: ABC
Interface for processing spans.
Source code in src/agents/tracing/processor_interface.py
on_trace_start
abstractmethod
on_trace_start(trace: Trace) -> None
Called when a trace is started.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
trace
|
Trace
|
The trace that started. |
required |
on_trace_end
abstractmethod
on_trace_end(trace: Trace) -> None
Called when a trace is finished.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
trace
|
Trace
|
The trace that started. |
required |
on_span_start
abstractmethod
on_span_start(span: Span[Any]) -> None
Called when a span is started.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
span
|
Span[Any]
|
The span that started. |
required |
on_span_end
abstractmethod
on_span_end(span: Span[Any]) -> None
Called when a span is finished. Should not block or raise exceptions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
span
|
Span[Any]
|
The span that finished. |
required |
shutdown
abstractmethod
TracingExporter
Bases: ABC
Exports traces and spans. For example, could log them or send them to a backend.