From 6741e2064d3b7826114b0d250ba9ebb415d951d9 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Thu, 11 Jan 2024 10:12:20 -0800 Subject: [PATCH] [xds interop] Use new CSM Observability APIs (#35508) Closes #35508 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35508 from yashykt:XdsInteropNewCsm 09d408c082b4cb8e534ce5143fea2cbb72b560f1 PiperOrigin-RevId: 597588033 --- test/cpp/interop/xds_interop_client.cc | 7 ++++--- test/cpp/interop/xds_interop_server.cc | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/test/cpp/interop/xds_interop_client.cc b/test/cpp/interop/xds_interop_client.cc index d5a6d51988c..b46926e517a 100644 --- a/test/cpp/interop/xds_interop_client.cc +++ b/test/cpp/interop/xds_interop_client.cc @@ -403,9 +403,10 @@ void EnableCsmObservability() { auto meter_provider = std::make_shared(); meter_provider->AddMetricReader(std::move(prometheus_exporter)); - grpc::experimental::CsmObservabilityBuilder observability; - observability.SetMeterProvider(std::move(meter_provider)); - auto status = observability.BuildAndRegister(); + grpc::experimental::OpenTelemetryPluginBuilder() + .AddPluginOption(grpc::experimental::MakeCsmOpenTelemetryPluginOption()) + .SetMeterProvider(std::move(meter_provider)) + .BuildAndRegisterGlobal(); } void RunServer(const int port, StatsWatchers* stats_watchers, diff --git a/test/cpp/interop/xds_interop_server.cc b/test/cpp/interop/xds_interop_server.cc index 9db746f7d36..0cab7527b52 100644 --- a/test/cpp/interop/xds_interop_server.cc +++ b/test/cpp/interop/xds_interop_server.cc @@ -54,9 +54,10 @@ void EnableCsmObservability() { auto meter_provider = std::make_shared(); meter_provider->AddMetricReader(std::move(prometheus_exporter)); - grpc::experimental::CsmObservabilityBuilder observability; - observability.SetMeterProvider(std::move(meter_provider)); - auto status = observability.BuildAndRegister(); + grpc::experimental::OpenTelemetryPluginBuilder() + .AddPluginOption(grpc::experimental::MakeCsmOpenTelemetryPluginOption()) + .SetMeterProvider(std::move(meter_provider)) + .BuildAndRegisterGlobal(); } int main(int argc, char** argv) {