Skip to content

Commit 7ce68c2

Browse files
committed
Added run_id to traces.
1 parent 1e1b058 commit 7ce68c2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

langchain/langchain_interceptor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ async def execute_workflow(
136136
# with trace(...):
137137
# return await self.next.execute_workflow(input)
138138
with temporalio.workflow.unsafe.sandbox_unrestricted():
139-
t = trace(name=f"execute_workflow:{name}")
139+
t = trace(name=f"execute_workflow:{name}", run_id=workflow.info().run_id)
140140
try:
141141
return await self.next.execute_workflow(input)
142142
finally:
@@ -153,7 +153,7 @@ def start_activity(
153153
self, input: temporalio.worker.StartActivityInput
154154
) -> temporalio.workflow.ActivityHandle:
155155
with temporalio.workflow.unsafe.sandbox_unrestricted():
156-
t = trace(name=f"start_activity:{input.activity}")
156+
t = trace(name=f"start_activity:{input.activity}", run_id=workflow.uuid4())
157157
try:
158158
set_header_from_context(input, temporalio.workflow.payload_converter())
159159
return self.next.start_activity(input)
@@ -165,7 +165,7 @@ async def start_child_workflow(
165165
self, input: temporalio.worker.StartChildWorkflowInput
166166
) -> temporalio.workflow.ChildWorkflowHandle:
167167
with temporalio.workflow.unsafe.sandbox_unrestricted():
168-
t = trace(name=f"start_child_workflow:{input.workflow}")
168+
t = trace(name=f"start_child_workflow:{input.workflow}", run_id=workflow.uuid4())
169169
try:
170170
set_header_from_context(input, temporalio.workflow.payload_converter())
171171
return await self.next.start_child_workflow(input)

0 commit comments

Comments
 (0)