Skip to content

Commit 3b4e682

Browse files
liuchaoxiaochaoren1
liuchao
authored andcommitted
Fix the error of not finding subspan
1 parent a71412e commit 3b4e682

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/app/application/l7_flow_tracing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,11 @@ def format_selftime(traces, parent_trace, child_ids, uid_index_map):
13941394
if parent_self_time == 0:
13951395
return
13961396
for child_id in child_ids:
1397-
child_trace = traces[uid_index_map[child_id]]
1397+
trace_index = uid_index_map.get(child_id, -1)
1398+
if trace_index == -1:
1399+
log.warning(f"The sub-span cannot be found: {child_id}")
1400+
continue
1401+
child_trace = traces[trace_index]
13981402
child_self_time = child_trace["end_time_us"] - child_trace[
13991403
"start_time_us"]
14001404
if child_self_time > 0 and child_self_time <= parent_trace["selftime"]:

0 commit comments

Comments
 (0)