From 0acfe4dbb4d994bcff93ca710107c6e062a6ce9c Mon Sep 17 00:00:00 2001 From: owentou Date: Wed, 13 Jul 2022 13:31:29 +0800 Subject: [PATCH] Fix unit test `OtlpMetricSerializationTest.ObservableGauge` Signed-off-by: owentou --- exporters/otlp/BUILD | 5 ++++- exporters/otlp/test/otlp_metrics_serialization_test.cc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/exporters/otlp/BUILD b/exporters/otlp/BUILD index 57d7f7f577..952cebd22a 100644 --- a/exporters/otlp/BUILD +++ b/exporters/otlp/BUILD @@ -225,7 +225,10 @@ cc_test( cc_test( name = "otlp_log_recordable_test", - srcs = ["test/otlp_log_recordable_test.cc"], + srcs = [ + "test/otlp_log_recordable_test.cc", + "test/otlp_metrics_serialization_test.cc", + ], tags = [ "otlp", "test", diff --git a/exporters/otlp/test/otlp_metrics_serialization_test.cc b/exporters/otlp/test/otlp_metrics_serialization_test.cc index 855d8941e5..22e6a2173f 100644 --- a/exporters/otlp/test/otlp_metrics_serialization_test.cc +++ b/exporters/otlp/test/otlp_metrics_serialization_test.cc @@ -85,7 +85,7 @@ static metrics_sdk::MetricData CreateObservableGaugeAggregationData() metrics_sdk::InstrumentDescriptor inst_desc = {"LastValue", "desc", "unit", metrics_sdk::InstrumentType::kObservableGauge, metrics_sdk::InstrumentValueType::kDouble}; - metrics_sdk::SumPointData s_data_1, s_data_2; + metrics_sdk::LastValuePointData s_data_1, s_data_2; s_data_1.value_ = 30.2; s_data_2.value_ = 50.2;