From 9c704b69621ac485661e373ed30ba40d0b76a8b3 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Thu, 18 Apr 2024 15:43:32 -0700 Subject: [PATCH] [xds] ToString: Output telemetry labels from cluster resource (#36401) Closes #36401 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36401 from yashykt:LogServiceNameLabels 5a22a5c6cc72e116d77ca634cdfd5d60d62532e5 PiperOrigin-RevId: 626171767 --- src/core/ext/xds/xds_cluster.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/ext/xds/xds_cluster.cc b/src/core/ext/xds/xds_cluster.cc index 194a88d5e49..313d513bf74 100644 --- a/src/core/ext/xds/xds_cluster.cc +++ b/src/core/ext/xds/xds_cluster.cc @@ -116,6 +116,15 @@ std::string XdsClusterResource::ToString() const { absl::StrCat("max_concurrent_requests=", max_concurrent_requests)); contents.push_back(absl::StrCat("override_host_statuses=", override_host_statuses.ToString())); + if (!service_telemetry_label.as_string_view().empty()) { + contents.push_back(absl::StrCat("service_name_telemetry_label=", + service_telemetry_label.as_string_view())); + } + if (!namespace_telemetry_label.as_string_view().empty()) { + contents.push_back( + absl::StrCat("service_namespace_telemetry_label=", + namespace_telemetry_label.as_string_view())); + } return absl::StrCat("{", absl::StrJoin(contents, ", "), "}"); }