From 10fcc863447a08e1b8b77dcba9b2ffd13ffd2786 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 8 Nov 2022 08:44:26 +0100 Subject: [PATCH] [Doc] Cleanup ENABLE_METRICS_PREVIEW (#1745) --- README.md | 13 ++--- exporters/ostream/CMakeLists.txt | 1 - exporters/ostream/src/metrics_exporter.cc | 59 ----------------------- 3 files changed, 4 insertions(+), 69 deletions(-) delete mode 100644 exporters/ostream/src/metrics_exporter.cc diff --git a/README.md b/README.md index 8eb0c51e7a..d12fb87dbd 100644 --- a/README.md +++ b/README.md @@ -13,15 +13,10 @@ The C++ [OpenTelemetry](https://opentelemetry.io/) client. | Signal | Status | Project | | ------- | ----------------------- | ------------------------------------------------------------------------ | | Traces | Public Release | N/A | -| Metrics | Public Release [1] | N/A | -| Logs | Experimental [2] | [Release Milestone](https://github.com/open-telemetry/opentelemetry-cpp/milestone/18)| - -* [1]: The older metrics implementation (based on old - specification) is now deprecated, and would be removed soon. - This can be included in build by setting - `ENABLE_METRICS_PREVIEW` preprocessor macro, and is included under - `*/_metrics/*` directory. -* [2]: The current Log Signal Implementation is Experimental, and will change as +| Metrics | Public Release | N/A | +| Logs | Experimental [1] | [Release Milestone](https://github.com/open-telemetry/opentelemetry-cpp/milestone/18)| + +* [1]: The current Log Signal Implementation is Experimental, and will change as the current OpenTelemetry Log specification matures. The current implementation can be included in build by setting `ENABLE_LOGS_PREVIEW` preprocessor macro. diff --git a/exporters/ostream/CMakeLists.txt b/exporters/ostream/CMakeLists.txt index 43d5f4b7c1..1d1c20a6c6 100644 --- a/exporters/ostream/CMakeLists.txt +++ b/exporters/ostream/CMakeLists.txt @@ -22,7 +22,6 @@ install( DIRECTORY include/opentelemetry/exporters/ostream DESTINATION include/opentelemetry/exporters PATTERN "*.h" - PATTERN "metrics_exporter.h" EXCLUDE PATTERN "log_Exporter.h" EXCLUDE) if(BUILD_TESTING) diff --git a/exporters/ostream/src/metrics_exporter.cc b/exporters/ostream/src/metrics_exporter.cc deleted file mode 100644 index 4f4bbfd065..0000000000 --- a/exporters/ostream/src/metrics_exporter.cc +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -#ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/exporters/ostream/metrics_exporter.h" - -OPENTELEMETRY_BEGIN_NAMESPACE -namespace exporter -{ -namespace metrics -{ - -OStreamMetricsExporter::OStreamMetricsExporter(std::ostream &sout) noexcept : sout_(sout) {} - -sdk::common::ExportResult OStreamMetricsExporter::Export( - const std::vector &records) noexcept -{ - for (auto record : records) - { - sout_ << "{" - << "\n name : " << record.GetName() - << "\n description : " << record.GetDescription() - << "\n labels : " << record.GetLabels(); - - auto aggregator = record.GetAggregator(); - - /** - * Unpack the AggregatorVariant from the record so we can pass the data type to - * PrintAggregatorVariant to unpack the Aggregator from the variant. - */ - if (nostd::holds_alternative>>( - aggregator)) - { - PrintAggregatorVariant(aggregator); - } - else if (nostd::holds_alternative< - std::shared_ptr>>(aggregator)) - { - PrintAggregatorVariant(aggregator); - } - else if (nostd::holds_alternative< - std::shared_ptr>>(aggregator)) - { - PrintAggregatorVariant(aggregator); - } - else if (nostd::holds_alternative< - std::shared_ptr>>(aggregator)) - { - PrintAggregatorVariant(aggregator); - } - sout_ << "\n}\n"; - } - return sdk::common::ExportResult::kSuccess; -} - -} // namespace metrics -} // namespace exporter -OPENTELEMETRY_END_NAMESPACE -#endif