11from datetime import timedelta
22
3+ import xray
34from temporalio import workflow
45from temporalio .exceptions import FailureError
56from temporalio .workflow import NexusClient
@@ -24,6 +25,7 @@ def __init__(self):
2425
2526@workflow .defn
2627class EchoCallerWorkflow (CallerWorkflowBase ):
28+ @xray .start_as_current_workflow_method_span ()
2729 @workflow .run
2830 async def run (self , message : str ) -> EchoOutput :
2931 op_output = await self .nexus_client .execute_operation (
@@ -35,6 +37,7 @@ async def run(self, message: str) -> EchoOutput:
3537
3638@workflow .defn
3739class Echo2CallerWorkflow (CallerWorkflowBase ):
40+ @xray .start_as_current_workflow_method_span ()
3841 @workflow .run
3942 async def run (self , message : str ) -> EchoOutput :
4043 op_output = await self .nexus_client .execute_operation (
@@ -46,6 +49,7 @@ async def run(self, message: str) -> EchoOutput:
4649
4750@workflow .defn
4851class Echo3CallerWorkflow (CallerWorkflowBase ):
52+ @xray .start_as_current_workflow_method_span ()
4953 @workflow .run
5054 async def run (self , message : str ) -> EchoOutput :
5155 op_output = await self .nexus_client .execute_operation (
@@ -57,6 +61,7 @@ async def run(self, message: str) -> EchoOutput:
5761
5862@workflow .defn
5963class HelloCallerWorkflow (CallerWorkflowBase ):
64+ @xray .start_as_current_workflow_method_span ()
6065 @workflow .run
6166 async def run (self , name : str ) -> HelloOutput :
6267 handle = await self .nexus_client .start_operation (
@@ -78,6 +83,7 @@ async def run(self, name: str) -> HelloOutput:
7883
7984@workflow .defn
8085class Hello2CallerWorkflow (CallerWorkflowBase ):
86+ @xray .start_as_current_workflow_method_span ()
8187 @workflow .run
8288 async def run (self , name : str ) -> HelloOutput :
8389 handle = await self .nexus_client .start_operation (
@@ -89,6 +95,7 @@ async def run(self, name: str) -> HelloOutput:
8995
9096@workflow .defn
9197class Hello3CallerWorkflow (CallerWorkflowBase ):
98+ @xray .start_as_current_workflow_method_span ()
9299 @workflow .run
93100 async def run (self , name : str ) -> HelloOutput :
94101 handle = await self .nexus_client .start_operation (
0 commit comments