class documentation

A tracer provider that is safe for use during workflow replay.

Warning

This class is experimental and may change in future versions. Use with caution in production environments.

This tracer provider wraps an OpenTelemetry TracerProvider and ensures that telemetry operations are safe during workflow replay by using replay-safe spans and tracers.

Method __init__ Initialize the replay-safe tracer provider.
Method add_span_processor Add a span processor to the underlying tracer provider.
Method force_flush Force flush the underlying tracer provider.
Method get_tracer Get a replay-safe tracer from the underlying provider.
Method id_generator Gets the temporal id generator associated with this provider.
Method shutdown Shutdown the underlying tracer provider.
Instance Variable _id_generator Undocumented
Instance Variable _tracer_provider Undocumented
def __init__(self, tracer_provider: trace_sdk.TracerProvider, id_generator: TemporalIdGenerator): (source)

Initialize the replay-safe tracer provider.

Parameters
tracer_provider:trace_sdk.TracerProviderThe underlying OpenTelemetry TracerProvider to wrap. Must use a _TemporalIdGenerator for replay safety.
id_generator:TemporalIdGeneratorUndocumented
Raises
ValueErrorIf the tracer provider doesn't use a _TemporalIdGenerator.
def add_span_processor(self, span_processor: trace_sdk.SpanProcessor): (source)

Add a span processor to the underlying tracer provider.

Parameters
span_processor:trace_sdk.SpanProcessorThe span processor to add.
def force_flush(self, timeout_millis: int = 30000) -> bool: (source)

Force flush the underlying tracer provider.

Parameters
timeout_millis:intTimeout in milliseconds.
Returns
boolTrue if flush was successful, False otherwise.
def get_tracer(self, instrumenting_module_name: str, instrumenting_library_version: str | None = None, schema_url: str | None = None, attributes: types.Attributes | None = None) -> Tracer: (source)

Get a replay-safe tracer from the underlying provider.

Parameters
instrumenting_module_name:strThe name of the instrumenting module.
instrumenting_library_version:str | NoneThe version of the instrumenting library.
schema_url:str | NoneThe schema URL for the tracer.
attributes:types.Attributes | NoneAdditional attributes for the tracer.
Returns
TracerA replay-safe tracer instance.
def id_generator(self) -> TemporalIdGenerator: (source)

Gets the temporal id generator associated with this provider.

def shutdown(self): (source)

Shutdown the underlying tracer provider.

_id_generator = (source)

Undocumented

_tracer_provider = (source)

Undocumented