From e640b89abcec06498d0581336344c2b110b6f6fb Mon Sep 17 00:00:00 2001 From: Ehsan Saei <71217171+esigo@users.noreply.github.com> Date: Fri, 21 Oct 2022 23:21:18 +0200 Subject: [PATCH] [Metrics SDK] Add support for Pull Metric Reader (#1701) --- CHANGELOG.md | 7 +++++++ .../exporters/ostream/metric_exporter.h | 10 ++++++++++ .../exporters/otlp/otlp_grpc_metric_exporter.h | 4 ++++ .../otlp/otlp_grpc_metric_exporter_factory.h | 12 ++++++++++++ .../exporters/otlp/otlp_http_metric_exporter.h | 6 +++++- .../otlp/otlp_http_metric_exporter_factory.h | 10 +++++++++- .../otlp/src/otlp_grpc_metric_exporter_factory.cc | 12 ++++++++++++ .../otlp/src/otlp_http_metric_exporter_factory.cc | 12 ++++++++++++ .../test/otlp_grpc_metric_exporter_factory_test.cc | 4 ++++ .../test/otlp_http_metric_exporter_factory_test.cc | 4 ++++ .../otlp/test/otlp_http_metric_exporter_test.cc | 12 ++++++++++++ .../opentelemetry/exporters/prometheus/exporter.h | 10 ++++++++++ .../export/periodic_exporting_metric_reader.cc | 7 +++++++ sdk/test/metrics/async_metric_storage_test.cc | 14 ++++++++++++++ sdk/test/metrics/meter_provider_sdk_test.cc | 12 ++++++++++++ sdk/test/metrics/metric_reader_test.cc | 8 ++++++++ .../periodic_exporting_metric_reader_test.cc | 8 ++++++++ 17 files changed, 150 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01db092a9a..6682f1b3ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Increment the: <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ## [1.8.1] 2022-12-04 * [ETW Exporter] Tail based sampling support [#1780](https://github.com/open-telemetry/opentelemetry-cpp/pull/1780) @@ -278,6 +279,8 @@ update the semantic convention in instrumentation library is needed. >>>>>>> 92618117 (Prepare v1.6.1 release (#1630)) ======= >>>>>>> cf9ebb02 (Add CMake OTELCPP_MAINTAINER_MODE (#1650)) +======= +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) * [TRACE SDK] Add trace sdk builders (#1393) [#1471](https://github.com/open-telemetry/opentelemetry-cpp/pull/1471) * [EXAMPLE] Fix memory ownership of InMemorySpanExporter (#1473) @@ -299,6 +302,10 @@ update the semantic convention in instrumentation library is needed. ======= ======= ======= +======= +* [Metrics SDK] Add support for Pull Metric Exporter [#1701](https://github.com/open-telemetry/opentelemetry-cpp/pull/1701) + which includes breaking change in the Metrics api. +>>>>>>> 70777ef9 ([Metrics SDK] Add support for Pull Metric Reader (#1701)) * [BUILD] Add CMake OTELCPP_MAINTAINER_MODE [#1650](https://github.com/open-telemetry/opentelemetry-cpp/pull/1650) * [SEMANTIC CONVENTIONS] Upgrade to version 1.14.0 [#1697](https://github.com/open-telemetry/opentelemetry-cpp/pull/1697) diff --git a/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter.h b/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter.h index 46fc58e059..5a6d82ff8c 100644 --- a/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter.h +++ b/exporters/ostream/include/opentelemetry/exporters/ostream/metric_exporter.h @@ -3,6 +3,7 @@ #pragma once +<<<<<<< HEAD #include #include #include "opentelemetry/common/spin_lock_mutex.h" @@ -10,6 +11,15 @@ #include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/version.h" +======= +# include +# include +# include "opentelemetry/common/spin_lock_mutex.h" +# include "opentelemetry/sdk/metrics/data/metric_data.h" +# include "opentelemetry/sdk/metrics/instruments.h" +# include "opentelemetry/sdk/metrics/push_metric_exporter.h" +# include "opentelemetry/version.h" +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_metric_exporter.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_metric_exporter.h index 73d93574c5..eb313053f4 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_metric_exporter.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_metric_exporter.h @@ -19,8 +19,12 @@ ======= # include "opentelemetry/exporters/otlp/otlp_environment.h" # include "opentelemetry/exporters/otlp/otlp_grpc_metric_exporter_options.h" +<<<<<<< HEAD # include "opentelemetry/sdk/metrics/metric_exporter.h" >>>>>>> 097ec4e7 (Add OTLP Metric Exporter Factory and `OtlpGrpcClient` (#1606)) +======= +# include "opentelemetry/sdk/metrics/push_metric_exporter.h" +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_metric_exporter_factory.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_metric_exporter_factory.h index 00cdfc8dd0..9bc0466188 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_metric_exporter_factory.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_metric_exporter_factory.h @@ -10,8 +10,12 @@ #ifndef ENABLE_METRICS_PREVIEW # include "opentelemetry/exporters/otlp/otlp_grpc_metric_exporter_options.h" +<<<<<<< HEAD # include "opentelemetry/sdk/metrics/metric_exporter.h" >>>>>>> 097ec4e7 (Add OTLP Metric Exporter Factory and `OtlpGrpcClient` (#1606)) +======= +# include "opentelemetry/sdk/metrics/push_metric_exporter.h" +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter @@ -28,20 +32,28 @@ class OtlpGrpcMetricExporterFactory /** * Create a OtlpGrpcMetricExporter. */ +<<<<<<< HEAD <<<<<<< HEAD static std::unique_ptr Create(); ======= static std::unique_ptr Create(); >>>>>>> 097ec4e7 (Add OTLP Metric Exporter Factory and `OtlpGrpcClient` (#1606)) +======= + static std::unique_ptr Create(); +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) /** * Create a OtlpGrpcMetricExporter. */ +<<<<<<< HEAD <<<<<<< HEAD static std::unique_ptr Create( ======= static std::unique_ptr Create( >>>>>>> 097ec4e7 (Add OTLP Metric Exporter Factory and `OtlpGrpcClient` (#1606)) +======= + static std::unique_ptr Create( +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) const OtlpGrpcMetricExporterOptions &options); }; diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter.h index 199ab4e360..4a3b114dd0 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter.h @@ -18,7 +18,7 @@ ======= #ifndef ENABLE_METRICS_PREVIEW -# include "opentelemetry/sdk/metrics/metric_exporter.h" +# include "opentelemetry/sdk/metrics/push_metric_exporter.h" # include "opentelemetry/exporters/otlp/otlp_environment.h" <<<<<<< HEAD @@ -93,8 +93,12 @@ struct OtlpHttpMetricExporterOptions /** * The OTLP exporter exports metrics data in OpenTelemetry Protocol (OTLP) format in HTTP. */ +<<<<<<< HEAD class OtlpHttpMetricExporter final : public opentelemetry::sdk::metrics::MetricExporter >>>>>>> 8d1f241d ([Metrics] Add OTLP http metric exporter (#1487)) +======= +class OtlpHttpMetricExporter final : public opentelemetry::sdk::metrics::PushMetricExporter +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) { public: /** diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_factory.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_factory.h index 245eea77d2..2a56bf52c4 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_factory.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_metric_exporter_factory.h @@ -12,7 +12,7 @@ #ifndef ENABLE_METRICS_PREVIEW # include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h" -# include "opentelemetry/sdk/metrics/metric_exporter.h" +# include "opentelemetry/sdk/metrics/push_metric_exporter.h" # include >>>>>>> 097ec4e7 (Add OTLP Metric Exporter Factory and `OtlpGrpcClient` (#1606)) @@ -32,20 +32,28 @@ class OtlpHttpMetricExporterFactory /** * Create a OtlpHttpMetricExporter. */ +<<<<<<< HEAD <<<<<<< HEAD static std::unique_ptr Create(); ======= static std::unique_ptr Create(); >>>>>>> 097ec4e7 (Add OTLP Metric Exporter Factory and `OtlpGrpcClient` (#1606)) +======= + static std::unique_ptr Create(); +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) /** * Create a OtlpHttpMetricExporter. */ +<<<<<<< HEAD <<<<<<< HEAD static std::unique_ptr Create( ======= static std::unique_ptr Create( >>>>>>> 097ec4e7 (Add OTLP Metric Exporter Factory and `OtlpGrpcClient` (#1606)) +======= + static std::unique_ptr Create( +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) const OtlpHttpMetricExporterOptions &options); }; diff --git a/exporters/otlp/src/otlp_grpc_metric_exporter_factory.cc b/exporters/otlp/src/otlp_grpc_metric_exporter_factory.cc index 27c641f527..550c475b23 100644 --- a/exporters/otlp/src/otlp_grpc_metric_exporter_factory.cc +++ b/exporters/otlp/src/otlp_grpc_metric_exporter_factory.cc @@ -23,17 +23,23 @@ namespace exporter namespace otlp { +<<<<<<< HEAD <<<<<<< HEAD std::unique_ptr OtlpGrpcMetricExporterFactory::Create() ======= std::unique_ptr OtlpGrpcMetricExporterFactory::Create() >>>>>>> 097ec4e7 (Add OTLP Metric Exporter Factory and `OtlpGrpcClient` (#1606)) +======= +std::unique_ptr +OtlpGrpcMetricExporterFactory::Create() +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) { OtlpGrpcMetricExporterOptions options; return Create(options); } +<<<<<<< HEAD <<<<<<< HEAD std::unique_ptr OtlpGrpcMetricExporterFactory::Create(const OtlpGrpcMetricExporterOptions &options) @@ -45,6 +51,12 @@ std::unique_ptr OtlpGrpcMetricExpor { std::unique_ptr exporter( >>>>>>> 097ec4e7 (Add OTLP Metric Exporter Factory and `OtlpGrpcClient` (#1606)) +======= +std::unique_ptr +OtlpGrpcMetricExporterFactory::Create(const OtlpGrpcMetricExporterOptions &options) +{ + std::unique_ptr exporter( +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) new OtlpGrpcMetricExporter(options)); return exporter; } diff --git a/exporters/otlp/src/otlp_http_metric_exporter_factory.cc b/exporters/otlp/src/otlp_http_metric_exporter_factory.cc index 1ab87b5098..acf041c5c9 100644 --- a/exporters/otlp/src/otlp_http_metric_exporter_factory.cc +++ b/exporters/otlp/src/otlp_http_metric_exporter_factory.cc @@ -19,17 +19,23 @@ namespace exporter namespace otlp { +<<<<<<< HEAD <<<<<<< HEAD std::unique_ptr OtlpHttpMetricExporterFactory::Create() ======= std::unique_ptr OtlpHttpMetricExporterFactory::Create() >>>>>>> 097ec4e7 (Add OTLP Metric Exporter Factory and `OtlpGrpcClient` (#1606)) +======= +std::unique_ptr +OtlpHttpMetricExporterFactory::Create() +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) { OtlpHttpMetricExporterOptions options; return Create(options); } +<<<<<<< HEAD <<<<<<< HEAD std::unique_ptr OtlpHttpMetricExporterFactory::Create(const OtlpHttpMetricExporterOptions &options) @@ -41,6 +47,12 @@ std::unique_ptr OtlpHttpMetricExpor { std::unique_ptr exporter( >>>>>>> 097ec4e7 (Add OTLP Metric Exporter Factory and `OtlpGrpcClient` (#1606)) +======= +std::unique_ptr +OtlpHttpMetricExporterFactory::Create(const OtlpHttpMetricExporterOptions &options) +{ + std::unique_ptr exporter( +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) new OtlpHttpMetricExporter(options)); return exporter; } diff --git a/exporters/otlp/test/otlp_grpc_metric_exporter_factory_test.cc b/exporters/otlp/test/otlp_grpc_metric_exporter_factory_test.cc index ddfca4cfe4..9dbd2780e8 100644 --- a/exporters/otlp/test/otlp_grpc_metric_exporter_factory_test.cc +++ b/exporters/otlp/test/otlp_grpc_metric_exporter_factory_test.cc @@ -40,11 +40,15 @@ TEST(OtlpGrpcMetricExporterFactory, BuildTest) OtlpGrpcMetricExporterOptions opts; opts.endpoint = "localhost:45454"; +<<<<<<< HEAD <<<<<<< HEAD std::unique_ptr exporter = ======= std::unique_ptr exporter = >>>>>>> 097ec4e7 (Add OTLP Metric Exporter Factory and `OtlpGrpcClient` (#1606)) +======= + std::unique_ptr exporter = +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) OtlpGrpcMetricExporterFactory::Create(opts); EXPECT_TRUE(exporter != nullptr); diff --git a/exporters/otlp/test/otlp_http_metric_exporter_factory_test.cc b/exporters/otlp/test/otlp_http_metric_exporter_factory_test.cc index 30fe9b1e78..0a879d77a9 100644 --- a/exporters/otlp/test/otlp_http_metric_exporter_factory_test.cc +++ b/exporters/otlp/test/otlp_http_metric_exporter_factory_test.cc @@ -54,11 +54,15 @@ TEST(OtlpHttpMetricExporterFactory, BuildTest) OtlpHttpMetricExporterOptions opts; opts.url = "localhost:45454"; +<<<<<<< HEAD <<<<<<< HEAD std::unique_ptr exporter = ======= std::unique_ptr exporter = >>>>>>> 097ec4e7 (Add OTLP Metric Exporter Factory and `OtlpGrpcClient` (#1606)) +======= + std::unique_ptr exporter = +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) OtlpHttpMetricExporterFactory::Create(opts); EXPECT_TRUE(exporter != nullptr); diff --git a/exporters/otlp/test/otlp_http_metric_exporter_test.cc b/exporters/otlp/test/otlp_http_metric_exporter_test.cc index fe0bb3bba0..b67328d108 100644 --- a/exporters/otlp/test/otlp_http_metric_exporter_test.cc +++ b/exporters/otlp/test/otlp_http_metric_exporter_test.cc @@ -114,6 +114,7 @@ namespace http_client = opentelemetry::ext::http::client; class OtlpHttpMetricExporterTestPeer : public ::testing::Test { public: +<<<<<<< HEAD <<<<<<< HEAD std::unique_ptr GetExporter( std::unique_ptr http_client) @@ -125,6 +126,12 @@ class OtlpHttpMetricExporterTestPeer : public ::testing::Test { return std::unique_ptr( >>>>>>> 8d1f241d ([Metrics] Add OTLP http metric exporter (#1487)) +======= + std::unique_ptr GetExporter( + std::unique_ptr http_client) + { + return std::unique_ptr( +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) new OtlpHttpMetricExporter(std::move(http_client))); } @@ -1177,6 +1184,7 @@ class OtlpHttpMetricExporterTestPeer : public ::testing::Test TEST(OtlpHttpMetricExporterTest, Shutdown) { +<<<<<<< HEAD <<<<<<< HEAD auto exporter = std::unique_ptr( new OtlpHttpMetricExporter()); @@ -1184,6 +1192,10 @@ TEST(OtlpHttpMetricExporterTest, Shutdown) auto exporter = std::unique_ptr(new OtlpHttpMetricExporter()); >>>>>>> 8d1f241d ([Metrics] Add OTLP http metric exporter (#1487)) +======= + auto exporter = std::unique_ptr( + new OtlpHttpMetricExporter()); +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) ASSERT_TRUE(exporter->Shutdown()); auto result = exporter->Export(opentelemetry::sdk::metrics::ResourceMetrics{}); EXPECT_EQ(result, opentelemetry::sdk::common::ExportResult::kFailure); diff --git a/exporters/prometheus/include/opentelemetry/exporters/prometheus/exporter.h b/exporters/prometheus/include/opentelemetry/exporters/prometheus/exporter.h index ab05fc71db..23299bbdad 100644 --- a/exporters/prometheus/include/opentelemetry/exporters/prometheus/exporter.h +++ b/exporters/prometheus/include/opentelemetry/exporters/prometheus/exporter.h @@ -3,6 +3,7 @@ #pragma once +<<<<<<< HEAD #include #include #include @@ -14,6 +15,15 @@ #include "opentelemetry/sdk/common/env_variables.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/version.h" +======= +# include +# include "opentelemetry/common/spin_lock_mutex.h" +# include "opentelemetry/exporters/prometheus/collector.h" +# include "opentelemetry/nostd/span.h" +# include "opentelemetry/sdk/common/env_variables.h" +# include "opentelemetry/sdk/metrics/push_metric_exporter.h" +# include "opentelemetry/version.h" +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) /** * This class is an implementation of the MetricsExporter interface and diff --git a/sdk/src/metrics/export/periodic_exporting_metric_reader.cc b/sdk/src/metrics/export/periodic_exporting_metric_reader.cc index 4220509b74..2f70ea5a2d 100644 --- a/sdk/src/metrics/export/periodic_exporting_metric_reader.cc +++ b/sdk/src/metrics/export/periodic_exporting_metric_reader.cc @@ -1,9 +1,16 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +<<<<<<< HEAD #include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h" #include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" +======= +#ifndef ENABLE_METRICS_PREVIEW +# include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h" +# include "opentelemetry/sdk/common/global_log_handler.h" +# include "opentelemetry/sdk/metrics/push_metric_exporter.h" +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) #include #include diff --git a/sdk/test/metrics/async_metric_storage_test.cc b/sdk/test/metrics/async_metric_storage_test.cc index 1640b0e0ae..5fe84e593b 100644 --- a/sdk/test/metrics/async_metric_storage_test.cc +++ b/sdk/test/metrics/async_metric_storage_test.cc @@ -1,6 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +<<<<<<< HEAD #include "opentelemetry/sdk/metrics/state/async_metric_storage.h" #include #include "opentelemetry/common/key_value_iterable_view.h" @@ -12,6 +13,19 @@ #include "opentelemetry/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/sdk/metrics/state/metric_collector.h" #include "opentelemetry/sdk/metrics/state/observable_registry.h" +======= +#ifndef ENABLE_METRICS_PREVIEW +# include "opentelemetry/sdk/metrics/state/async_metric_storage.h" +# include "opentelemetry/common/key_value_iterable_view.h" +# include "opentelemetry/sdk/metrics/async_instruments.h" +# include "opentelemetry/sdk/metrics/instruments.h" +# include "opentelemetry/sdk/metrics/meter_context.h" +# include "opentelemetry/sdk/metrics/metric_reader.h" +# include "opentelemetry/sdk/metrics/observer_result.h" +# include "opentelemetry/sdk/metrics/push_metric_exporter.h" +# include "opentelemetry/sdk/metrics/state/metric_collector.h" +# include "opentelemetry/sdk/metrics/state/observable_registry.h" +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) #include #include diff --git a/sdk/test/metrics/meter_provider_sdk_test.cc b/sdk/test/metrics/meter_provider_sdk_test.cc index 7663ca9b01..b539888aee 100644 --- a/sdk/test/metrics/meter_provider_sdk_test.cc +++ b/sdk/test/metrics/meter_provider_sdk_test.cc @@ -1,6 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +<<<<<<< HEAD #include #include "opentelemetry/sdk/metrics/export/metric_producer.h" #include "opentelemetry/sdk/metrics/meter.h" @@ -9,6 +10,17 @@ #include "opentelemetry/sdk/metrics/push_metric_exporter.h" #include "opentelemetry/sdk/metrics/view/instrument_selector.h" #include "opentelemetry/sdk/metrics/view/meter_selector.h" +======= +#ifndef ENABLE_METRICS_PREVIEW +# include +# include "opentelemetry/sdk/metrics/export/metric_producer.h" +# include "opentelemetry/sdk/metrics/meter.h" +# include "opentelemetry/sdk/metrics/meter_provider.h" +# include "opentelemetry/sdk/metrics/metric_reader.h" +# include "opentelemetry/sdk/metrics/push_metric_exporter.h" +# include "opentelemetry/sdk/metrics/view/instrument_selector.h" +# include "opentelemetry/sdk/metrics/view/meter_selector.h" +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/metric_reader_test.cc b/sdk/test/metrics/metric_reader_test.cc index de787d617c..dbac5b6278 100644 --- a/sdk/test/metrics/metric_reader_test.cc +++ b/sdk/test/metrics/metric_reader_test.cc @@ -1,10 +1,18 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +<<<<<<< HEAD #include "opentelemetry/sdk/metrics/metric_reader.h" #include #include "opentelemetry/sdk/metrics/meter_context.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" +======= +#ifndef ENABLE_METRICS_PREVIEW +# include "opentelemetry/sdk/metrics/metric_reader.h" +# include +# include "opentelemetry/sdk/metrics/meter_context.h" +# include "opentelemetry/sdk/metrics/push_metric_exporter.h" +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) using namespace opentelemetry; using namespace opentelemetry::sdk::instrumentationscope; diff --git a/sdk/test/metrics/periodic_exporting_metric_reader_test.cc b/sdk/test/metrics/periodic_exporting_metric_reader_test.cc index cd789b5028..78ed842f7a 100644 --- a/sdk/test/metrics/periodic_exporting_metric_reader_test.cc +++ b/sdk/test/metrics/periodic_exporting_metric_reader_test.cc @@ -5,7 +5,15 @@ #include "opentelemetry/sdk/metrics/export/metric_producer.h" #include "opentelemetry/sdk/metrics/push_metric_exporter.h" +<<<<<<< HEAD #include +======= +# include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h" +# include "opentelemetry/sdk/metrics/export/metric_producer.h" +# include "opentelemetry/sdk/metrics/push_metric_exporter.h" + +# include +>>>>>>> c6552dca ([Metrics SDK] Add support for Pull Metric Reader (#1701)) using namespace opentelemetry; using namespace opentelemetry::sdk::instrumentationscope;