Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Processor interface

TracingProcessor

Bases:ABC

Interface for processing spans.

Source code insrc/agents/tracing/processor_interface.py
classTracingProcessor(abc.ABC):"""Interface for processing spans."""@abc.abstractmethoddefon_trace_start(self,trace:"Trace")->None:"""Called when a trace is started.        Args:            trace: The trace that started.        """pass@abc.abstractmethoddefon_trace_end(self,trace:"Trace")->None:"""Called when a trace is finished.        Args:            trace: The trace that finished.        """pass@abc.abstractmethoddefon_span_start(self,span:"Span[Any]")->None:"""Called when a span is started.        Args:            span: The span that started.        """pass@abc.abstractmethoddefon_span_end(self,span:"Span[Any]")->None:"""Called when a span is finished. Should not block or raise exceptions.        Args:            span: The span that finished.        """pass@abc.abstractmethoddefshutdown(self)->None:"""Called when the application stops."""pass@abc.abstractmethoddefforce_flush(self)->None:"""Forces an immediate flush of all queued spans/traces."""pass

on_trace_startabstractmethod

on_trace_start(trace:Trace)->None

Called when a trace is started.

Parameters:

NameTypeDescriptionDefault
traceTrace

The trace that started.

required
Source code insrc/agents/tracing/processor_interface.py
@abc.abstractmethoddefon_trace_start(self,trace:"Trace")->None:"""Called when a trace is started.    Args:        trace: The trace that started.    """pass

on_trace_endabstractmethod

on_trace_end(trace:Trace)->None

Called when a trace is finished.

Parameters:

NameTypeDescriptionDefault
traceTrace

The trace that finished.

required
Source code insrc/agents/tracing/processor_interface.py
@abc.abstractmethoddefon_trace_end(self,trace:"Trace")->None:"""Called when a trace is finished.    Args:        trace: The trace that finished.    """pass

on_span_startabstractmethod

on_span_start(span:Span[Any])->None

Called when a span is started.

Parameters:

NameTypeDescriptionDefault
spanSpan[Any]

The span that started.

required
Source code insrc/agents/tracing/processor_interface.py
@abc.abstractmethoddefon_span_start(self,span:"Span[Any]")->None:"""Called when a span is started.    Args:        span: The span that started.    """pass

on_span_endabstractmethod

on_span_end(span:Span[Any])->None

Called when a span is finished. Should not block or raise exceptions.

Parameters:

NameTypeDescriptionDefault
spanSpan[Any]

The span that finished.

required
Source code insrc/agents/tracing/processor_interface.py
@abc.abstractmethoddefon_span_end(self,span:"Span[Any]")->None:"""Called when a span is finished. Should not block or raise exceptions.    Args:        span: The span that finished.    """pass

shutdownabstractmethod

shutdown()->None

Called when the application stops.

Source code insrc/agents/tracing/processor_interface.py
@abc.abstractmethoddefshutdown(self)->None:"""Called when the application stops."""pass

force_flushabstractmethod

force_flush()->None

Forces an immediate flush of all queued spans/traces.

Source code insrc/agents/tracing/processor_interface.py
@abc.abstractmethoddefforce_flush(self)->None:"""Forces an immediate flush of all queued spans/traces."""pass

TracingExporter

Bases:ABC

Exports traces and spans. For example, could log them or send them to a backend.

Source code insrc/agents/tracing/processor_interface.py
classTracingExporter(abc.ABC):"""Exports traces and spans. For example, could log them or send them to a backend."""@abc.abstractmethoddefexport(self,items:list["Trace | Span[Any]"])->None:"""Exports a list of traces and spans.        Args:            items: The items to export.        """pass

exportabstractmethod

export(items:list[Trace|Span[Any]])->None

Exports a list of traces and spans.

Parameters:

NameTypeDescriptionDefault
itemslist[Trace |Span[Any]]

The items to export.

required
Source code insrc/agents/tracing/processor_interface.py
@abc.abstractmethoddefexport(self,items:list["Trace | Span[Any]"])->None:"""Exports a list of traces and spans.    Args:        items: The items to export.    """pass

[8]ページ先頭

©2009-2025 Movatter.jp