[xds interop] Use new CSM Observability APIs

pull/35508/head
Yash Tibrewal 11 months ago
parent 3020a68b86
commit 09d408c082
  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 =
std::make_shared<opentelemetry::sdk::metrics::MeterProvider>();
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,

@ -54,9 +54,10 @@ void EnableCsmObservability() {
auto meter_provider =
std::make_shared<opentelemetry::sdk::metrics::MeterProvider>();
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) {

Loading…
Cancel
Save