Skip to content

Commit

Permalink
Repair span traceability
Browse files Browse the repository at this point in the history
**Phenomenon and reproduction steps**

**Root cause and solution**

**Impactions**

**Test method**

**Affected branch(es)**

* main

**Checklist**

- [ ] Dependencies update required
- [ ] Common bug (similar problem in other repo)
  • Loading branch information
xiaochaoren1 authored and SongZhen0704 committed Aug 28, 2023
1 parent 0e8de3d commit 0029e3d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/app/application/tracing_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,13 @@ async def trace_l7_flow(self,
dataframe_flowmetas = self.app_spans_df
if dataframe_flowmetas.empty:
return []
related_map[dataframe_flowmetas['_id'][0]] = [
f"{dataframe_flowmetas['_id'][0]}-base"
]
for i in range(len(self.app_spans)):
for j in range(len(self.app_spans)):
if i == j:
continue
related_map[dataframe_flowmetas['_id'][i]].append(
str(dataframe_flowmetas['_id'][j]) + "-app")

trace_id = ''
allow_multiple_trace_ids_in_tracing_result = config.allow_multiple_trace_ids_in_tracing_result
for i in range(max_iteration):
Expand Down Expand Up @@ -340,7 +344,7 @@ def update_time(self):

# Completing application span attribute information
def complete_app_span(self):
for app_span in self.app_spans:
for i, app_span in enumerate(self.app_spans):
tap_side_by_span_kind = TAP_SIDE_BY_SPAN_KIND.get(
app_span.get('span_kind'))
app_span["tap_side"] = tap_side_by_span_kind
Expand All @@ -349,7 +353,7 @@ def complete_app_span(self):
"type", "req_tcp_seq", "resp_tcp_seq", "l7_protocol",
"vtap_id", "protocol", "flow_id",
"syscall_trace_id_request", "syscall_trace_id_response",
"_id", "syscall_cap_seq_0", "tap_port_type",
"syscall_cap_seq_0", "tap_port_type",
"auto_instance_0_icon_id", "auto_instance_1_icon_id",
"auto_service_type_0", "response_status",
"auto_service_id_0", "auto_instance_id_1",
Expand All @@ -376,3 +380,4 @@ def complete_app_span(self):
app_span[tag_str] = "" if not app_span.get(
tag_str) else app_span[tag_str]
app_span["resource_from_vtap"] = (0, 0, "", 0, 0, "")
app_span["_id"] = i

0 comments on commit 0029e3d

Please sign in to comment.