class documentation

OTEL-aware variant that enhances headers with OpenTelemetry span context.

Method __init__ Initialize OTEL-aware context propagation interceptor.
Method context_from_header Extracts and initializes trace information the input header.
Method header_contents Get header contents enhanced with OpenTelemetry span context.
Instance Variable _otel_id_generator Undocumented

Inherited from OpenAIAgentsContextPropagationInterceptor:

Method get_header_contents Extract trace context information from input headers.
Method intercept_activity Intercepts activity calls to propagate trace context.
Method intercept_client Intercepts client calls to propagate trace context.
Method maybe_span Context manager that conditionally creates a span.
Method set_header_from_context Inserts the OpenAI Agents trace/span data in the input header.
Method span_context_from_header_contents Initialize span context from header contents.
Method trace_context_from_header_contents Initialize trace context from header contents.
Method workflow_interceptor_class Returns the workflow interceptor class to propagate trace context.
Instance Variable _add_temporal_spans Undocumented
Instance Variable _payload_converter Undocumented
Instance Variable _start_traces Undocumented

Inherited from Interceptor (via OpenAIAgentsContextPropagationInterceptor, Interceptor):

Method intercept_nexus_operation Method called for intercepting a Nexus operation.
def __init__(self, otel_id_generator: TemporalIdGenerator, payload_converter: temporalio.converter.PayloadConverter = temporalio.converter.default().payload_converter, add_temporal_spans: bool = True): (source)

Initialize OTEL-aware context propagation interceptor.

Parameters
otel_id_generator:TemporalIdGeneratorGenerator for OTEL-compatible IDs.
payload_converter:temporalio.converter.PayloadConverterConverter for serializing trace context.
add_temporal_spans:boolWhether to add Temporal-specific spans.
def context_from_header(self, input: _InputWithHeaders): (source)
def header_contents(self) -> dict[str, Any]: (source)

Get header contents enhanced with OpenTelemetry span context.

Returns
dict[str, Any]Dictionary containing trace context with OTEL span information.
_otel_id_generator = (source)

Undocumented