class OpenAIAgentsTracingInterceptor(temporalio.client.Interceptor, temporalio.worker.Interceptor): (source)
Constructor: OpenAIAgentsTracingInterceptor(payload_converter)
Interceptor that propagates OpenAI agent tracing context through Temporal workflows and activities.
Warning
This API is experimental and may change in future versions. Use with caution in production environments.
This interceptor enables tracing of OpenAI agent operations across Temporal workflows and activities. It propagates trace context through workflow and activity boundaries, allowing for end-to-end tracing of agent operations.
The interceptor handles: 1. Propagating trace context from client to workflow 2. Propagating trace context from workflow to activities 3. Maintaining trace context across workflow and activity boundaries
- Example usage:
- interceptor = OpenAIAgentsTracingInterceptor() client = await Client.connect("localhost:7233", interceptors=[interceptor]) worker = Worker(client, task_queue="my-task-queue", interceptors=[interceptor])
Method | __init__ |
Initialize the interceptor with a payload converter. |
Method | intercept |
Intercepts activity calls to propagate trace context. |
Method | intercept |
Intercepts client calls to propagate trace context. |
Method | workflow |
Returns the workflow interceptor class to propagate trace context. |
Instance Variable | _payload |
Undocumented |
temporalio.converter.PayloadConverter
= temporalio.converter.default().payload_converter):
(source)
¶
Initialize the interceptor with a payload converter.
Parameters | |
payloadtemporalio.converter.PayloadConverter | The payload converter to use for serializing/deserializing trace context. Defaults to the default Temporal payload converter. |
temporalio.worker.ActivityInboundInterceptor
) -> temporalio.worker.ActivityInboundInterceptor
:
(source)
¶
Intercepts activity calls to propagate trace context.
Parameters | |
next:temporalio.worker.ActivityInboundInterceptor | The next interceptor in the chain. |
Returns | |
temporalio.worker.ActivityInboundInterceptor | An interceptor that propagates trace context for activity operations. |
temporalio.client.OutboundInterceptor
) -> temporalio.client.OutboundInterceptor
:
(source)
¶
Intercepts client calls to propagate trace context.
Parameters | |
next:temporalio.client.OutboundInterceptor | The next interceptor in the chain. |
Returns | |
temporalio.client.OutboundInterceptor | An interceptor that propagates trace context for client operations. |
temporalio.worker.WorkflowInterceptorClassInput
) -> type[ _ContextPropagationWorkflowInboundInterceptor]
:
(source)
¶
Returns the workflow interceptor class to propagate trace context.
Parameters | |
input:temporalio.worker.WorkflowInterceptorClassInput | The input for creating the workflow interceptor. |
Returns | |
type[ | The class of the workflow interceptor that propagates trace context. |