Skip to content

Commit bc63118

Browse files
committed
fix: fix the traceid-evaluationid mismatch
1 parent 124b8f6 commit bc63118

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/uipath/_cli/_evals/_runtime.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,12 @@ def _upsert():
210210
def on_start(
211211
self, span: Span, parent_context: context_api.Context | None = None
212212
) -> None:
213-
"""Called when span starts - upsert with RUNNING status (non-blocking)."""
213+
"""Called when span starts - upsert with RUNNING status (non-blocking).
214+
215+
Parent spans (eval_set_run, evaluation) are created before their children
216+
in the code flow, so their async upsert tasks are submitted first, ensuring
217+
correct ordering at the backend without blocking evaluation execution.
218+
"""
214219
# Only track evaluation-related spans
215220
if span.attributes and self._is_eval_span(span):
216221
self._upsert_span_async(span, status_override=self.span_status.RUNNING)

src/uipath/_cli/cli_eval.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ async def execute_eval():
207207
LlmOpsHttpExporter() if should_register_progress_reporter else None
208208
)
209209

210+
# Set trace_id early if eval_set_run_id is already known
211+
if live_tracking_exporter and eval_context.eval_set_run_id:
212+
live_tracking_exporter.trace_id = eval_context.eval_set_run_id
213+
210214
if should_register_progress_reporter:
211215
progress_reporter = StudioWebProgressReporter(
212216
live_tracking_exporter

0 commit comments

Comments
 (0)