Skip to content

Commit 949297e

Browse files
committed
stream_info_fromatter: support extracting route name from routeEntry
Change-Id: Ic4e5d6e719f6e1cd5713f9ceff77125397747f6d
1 parent 384e5aa commit 949297e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

source/common/formatter/substitution_formatter.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,9 +1410,21 @@ const StreamInfoFormatter::FieldExtractorLookupTbl& StreamInfoFormatter::getKnow
14101410
[](const StreamInfo::StreamInfo& stream_info) {
14111411
absl::optional<std::string> result;
14121412
std::string route_name = stream_info.getRouteName();
1413+
#if defined(HIGRESS)
14131414
if (!route_name.empty()) {
14141415
result = route_name;
1416+
} else {
1417+
auto route = stream_info.route();
1418+
if (route && route->routeEntry()) {
1419+
result = route->routeEntry()->routeName();
1420+
}
14151421
}
1422+
#else
1423+
if (!route_name.empty()) {
1424+
result = route_name;
1425+
}
1426+
#endif
1427+
14161428
return result;
14171429
});
14181430
}}},

0 commit comments

Comments
 (0)