[xds interop] Use new CSM Observability APIs (#35508)

Closes #35508

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35508 from yashykt:XdsInteropNewCsm 09d408c082
PiperOrigin-RevId: 597588033
pull/35521/head
Yash Tibrewal 1 year ago committed by Copybara-Service
parent 1ec0559b34
commit 6741e2064d
  1. 7
      test/cpp/interop/xds_interop_client.cc
  2. 7
      test/cpp/interop/xds_interop_server.cc

@ -403,9 +403,10 @@ void EnableCsmObservability() {
auto meter_provider = auto meter_provider =
std::make_shared<opentelemetry::sdk::metrics::MeterProvider>(); std::make_shared<opentelemetry::sdk::metrics::MeterProvider>();
meter_provider->AddMetricReader(std::move(prometheus_exporter)); meter_provider->AddMetricReader(std::move(prometheus_exporter));
grpc::experimental::CsmObservabilityBuilder observability; grpc::experimental::OpenTelemetryPluginBuilder()
observability.SetMeterProvider(std::move(meter_provider)); .AddPluginOption(grpc::experimental::MakeCsmOpenTelemetryPluginOption())
auto status = observability.BuildAndRegister(); .SetMeterProvider(std::move(meter_provider))
.BuildAndRegisterGlobal();
} }
void RunServer(const int port, StatsWatchers* stats_watchers, void RunServer(const int port, StatsWatchers* stats_watchers,

@ -54,9 +54,10 @@ void EnableCsmObservability() {
auto meter_provider = auto meter_provider =
std::make_shared<opentelemetry::sdk::metrics::MeterProvider>(); std::make_shared<opentelemetry::sdk::metrics::MeterProvider>();
meter_provider->AddMetricReader(std::move(prometheus_exporter)); meter_provider->AddMetricReader(std::move(prometheus_exporter));
grpc::experimental::CsmObservabilityBuilder observability; grpc::experimental::OpenTelemetryPluginBuilder()
observability.SetMeterProvider(std::move(meter_provider)); .AddPluginOption(grpc::experimental::MakeCsmOpenTelemetryPluginOption())
auto status = observability.BuildAndRegister(); .SetMeterProvider(std::move(meter_provider))
.BuildAndRegisterGlobal();
} }
int main(int argc, char** argv) { int main(int argc, char** argv) {

Loading…
Cancel
Save