File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments