Skip to content

Commit 7a22f6b

Browse files
taloricsharang
authored andcommitted
[app] add _querier_region for front-end
1 parent 964d35c commit 7a22f6b

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

app/app/application/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def complete_app_span(self, app_spans):
5858
for tag_str in [
5959
"x_request_id_0", "x_request_id_1", "auto_instance_0",
6060
"auto_instance_1", "subnet_0", "app_service",
61-
"_tsdb_region_name", "process_kname_0",
61+
"_querier_region", "process_kname_0",
6262
"http_proxy_client", "auto_instance_1_node_type",
6363
"app_instance", "response_exception", "version",
6464
"l7_protocol_str", "auto_instance_0_node_type",

app/app/application/l7_flow_tracing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,8 @@ def sort_all_flows(dataframe_flows: DataFrame, network_delay_us: int,
18861886
if merge_flow(flows, flow): # 合并单向Flow为会话
18871887
continue
18881888
flow['_index'] = len(flows) # assert '_index' not in flow
1889+
flow['_querier_region'] = dict_flows['_querier_region'][
1890+
index] # set _querier_region for multi-region
18891891
flows.append(flow)
18901892
# 注意:不要对 flows 再做排序,下面的代码会通过 flows[flow_index] 来反查 flow
18911893

@@ -2798,7 +2800,9 @@ def _get_flow_dict(flow: DataFrame):
27982800
"tap_id":
27992801
flow.get("tap_id", None),
28002802
"tap":
2801-
flow.get("tap", None)
2803+
flow.get("tap", None),
2804+
"_querier_region":
2805+
flow.get("_querier_region", None)
28022806
}
28032807
if flow["signal_source"] == L7_FLOW_SIGNAL_SOURCE_EBPF:
28042808
flow_dict["subnet"] = flow.get("subnet")

app/app/data/querier_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async def exec(self):
7676
'columns'):
7777
result_df = self.to_dataframe(result_dict)
7878
if self.region is not None:
79-
result_df['_tsdb_region_name'] = self.region
79+
result_df['_querier_region'] = self.region
8080
if self.query_id is not None:
8181
result_df['query_id'] = self.query_id
8282
if status != 200:

0 commit comments

Comments
 (0)