diff --git a/README.md b/README.md index ac866ec985..0bd75448b9 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ The C++ [OpenTelemetry](https://opentelemetry.io/) client. | Signal | Status | Project | | ------- | ---------------------- | ------------------------------------------------------------------------ | -| Traces | Public Release | N/A | -| Metrics | Development paused [1] | N/A | +| Traces | Public Release | N/A | +| Metrics | Development [1] | N/A | | Logs | Experimental [2] | N/A | -* [1]: The development of the metrics API and SDK has paused due to limited development resources, prioritization of a stable Traces release, and waiting for availability of stable Metrics (API + SDK) design from the OpenTelemetry specification. The current implementation can be included in build by setting `ENABLE_METRICS_PREVIEW` preprocessor macro. +* [1]: The development of the metrics API and SDK based on new stable specification is ongoing. The timelines would be available in release milestone. The earlier implementation (based on old specification) can be included in build by setting `ENABLE_METRICS_PREVIEW` preprocessor macro, and is included under `*/_metrics/*` directory. This would be eventually removed once the ongoing implemetation is stable. * [2]: 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. ## OpenTelemetry Specification Compatibility Matrix diff --git a/api/include/opentelemetry/metrics/async_instruments.h b/api/include/opentelemetry/_metrics/async_instruments.h similarity index 95% rename from api/include/opentelemetry/metrics/async_instruments.h rename to api/include/opentelemetry/_metrics/async_instruments.h index 867382ec19..53024b07a5 100644 --- a/api/include/opentelemetry/metrics/async_instruments.h +++ b/api/include/opentelemetry/_metrics/async_instruments.h @@ -4,8 +4,8 @@ #pragma once #ifdef ENABLE_METRICS_PREVIEW -# include "instrument.h" -# include "observer_result.h" +# include "opentelemetry/_metrics/instrument.h" +# include "opentelemetry/_metrics/observer_result.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace metrics diff --git a/api/include/opentelemetry/metrics/instrument.h b/api/include/opentelemetry/_metrics/instrument.h similarity index 100% rename from api/include/opentelemetry/metrics/instrument.h rename to api/include/opentelemetry/_metrics/instrument.h diff --git a/api/include/opentelemetry/metrics/meter.h b/api/include/opentelemetry/_metrics/meter.h similarity index 98% rename from api/include/opentelemetry/metrics/meter.h rename to api/include/opentelemetry/_metrics/meter.h index a2adafb9da..11311cf14b 100644 --- a/api/include/opentelemetry/metrics/meter.h +++ b/api/include/opentelemetry/_metrics/meter.h @@ -4,9 +4,9 @@ #pragma once #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/metrics/async_instruments.h" -# include "opentelemetry/metrics/instrument.h" -# include "opentelemetry/metrics/sync_instruments.h" +# include "opentelemetry/_metrics/async_instruments.h" +# include "opentelemetry/_metrics/instrument.h" +# include "opentelemetry/_metrics/sync_instruments.h" # include "opentelemetry/nostd/shared_ptr.h" # include "opentelemetry/nostd/span.h" # include "opentelemetry/nostd/string_view.h" diff --git a/api/include/opentelemetry/metrics/meter_provider.h b/api/include/opentelemetry/_metrics/meter_provider.h similarity index 94% rename from api/include/opentelemetry/metrics/meter_provider.h rename to api/include/opentelemetry/_metrics/meter_provider.h index 840c7d2aa7..78ce42ee9a 100644 --- a/api/include/opentelemetry/metrics/meter_provider.h +++ b/api/include/opentelemetry/_metrics/meter_provider.h @@ -4,7 +4,7 @@ #pragma once #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/metrics/meter.h" +# include "opentelemetry/_metrics/meter.h" # include "opentelemetry/nostd/shared_ptr.h" # include "opentelemetry/nostd/string_view.h" diff --git a/api/include/opentelemetry/metrics/noop.h b/api/include/opentelemetry/_metrics/noop.h similarity index 98% rename from api/include/opentelemetry/metrics/noop.h rename to api/include/opentelemetry/_metrics/noop.h index 3a38df732b..ecd5c53170 100644 --- a/api/include/opentelemetry/metrics/noop.h +++ b/api/include/opentelemetry/_metrics/noop.h @@ -8,11 +8,11 @@ // This file is part of the internal implementation of OpenTelemetry. Nothing in this file should be // used directly. Please refer to meter.h for documentation on these interfaces. -# include "opentelemetry/metrics/async_instruments.h" -# include "opentelemetry/metrics/instrument.h" -# include "opentelemetry/metrics/meter.h" -# include "opentelemetry/metrics/meter_provider.h" -# include "opentelemetry/metrics/sync_instruments.h" +# include "opentelemetry/_metrics/async_instruments.h" +# include "opentelemetry/_metrics/instrument.h" +# include "opentelemetry/_metrics/meter.h" +# include "opentelemetry/_metrics/meter_provider.h" +# include "opentelemetry/_metrics/sync_instruments.h" # include "opentelemetry/nostd/string_view.h" # include "opentelemetry/nostd/unique_ptr.h" # include "opentelemetry/version.h" diff --git a/api/include/opentelemetry/metrics/observer_result.h b/api/include/opentelemetry/_metrics/observer_result.h similarity index 94% rename from api/include/opentelemetry/metrics/observer_result.h rename to api/include/opentelemetry/_metrics/observer_result.h index 90ad10efc2..de4b36c0dc 100644 --- a/api/include/opentelemetry/metrics/observer_result.h +++ b/api/include/opentelemetry/_metrics/observer_result.h @@ -4,7 +4,7 @@ #pragma once #ifdef ENABLE_METRICS_PREVIEW -# include "instrument.h" +# include "opentelemetry/_metrics/instrument.h" # include "opentelemetry/nostd/shared_ptr.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/api/include/opentelemetry/metrics/provider.h b/api/include/opentelemetry/_metrics/provider.h similarity index 93% rename from api/include/opentelemetry/metrics/provider.h rename to api/include/opentelemetry/_metrics/provider.h index e5b6d1b66f..e079b34d5f 100644 --- a/api/include/opentelemetry/metrics/provider.h +++ b/api/include/opentelemetry/_metrics/provider.h @@ -5,9 +5,9 @@ #ifdef ENABLE_METRICS_PREVIEW # include +# include "opentelemetry/_metrics/meter_provider.h" +# include "opentelemetry/_metrics/noop.h" # include "opentelemetry/common/spin_lock_mutex.h" -# include "opentelemetry/metrics/meter_provider.h" -# include "opentelemetry/metrics/noop.h" # include "opentelemetry/nostd/shared_ptr.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/api/include/opentelemetry/metrics/sync_instruments.h b/api/include/opentelemetry/_metrics/sync_instruments.h similarity index 99% rename from api/include/opentelemetry/metrics/sync_instruments.h rename to api/include/opentelemetry/_metrics/sync_instruments.h index b7eb09e84d..56ccea7074 100644 --- a/api/include/opentelemetry/metrics/sync_instruments.h +++ b/api/include/opentelemetry/_metrics/sync_instruments.h @@ -4,7 +4,7 @@ #pragma once #ifdef ENABLE_METRICS_PREVIEW -# include "instrument.h" +# include "opentelemetry/_metrics/instrument.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace metrics diff --git a/api/test/CMakeLists.txt b/api/test/CMakeLists.txt index 0e4c9bd0f3..7eb67a6b55 100644 --- a/api/test/CMakeLists.txt +++ b/api/test/CMakeLists.txt @@ -4,7 +4,7 @@ add_subdirectory(plugin) add_subdirectory(nostd) add_subdirectory(trace) if(WITH_METRICS_PREVIEW) - add_subdirectory(metrics) + add_subdirectory(_metrics) endif() if(WITH_LOGS_PREVIEW) add_subdirectory(logs) diff --git a/api/test/metrics/BUILD b/api/test/_metrics/BUILD similarity index 100% rename from api/test/metrics/BUILD rename to api/test/_metrics/BUILD diff --git a/api/test/metrics/CMakeLists.txt b/api/test/_metrics/CMakeLists.txt similarity index 100% rename from api/test/metrics/CMakeLists.txt rename to api/test/_metrics/CMakeLists.txt diff --git a/api/test/metrics/meter_provider_test.cc b/api/test/_metrics/meter_provider_test.cc similarity index 96% rename from api/test/metrics/meter_provider_test.cc rename to api/test/_metrics/meter_provider_test.cc index 862ce4a7fe..b2d54be449 100644 --- a/api/test/metrics/meter_provider_test.cc +++ b/api/test/_metrics/meter_provider_test.cc @@ -3,7 +3,7 @@ #ifdef ENABLE_METRICS_PREVIEW # include -# include "opentelemetry/metrics/provider.h" +# include "opentelemetry/_metrics/provider.h" # include "opentelemetry/nostd/shared_ptr.h" using opentelemetry::metrics::Meter; diff --git a/api/test/metrics/noop_instrument_test.cc b/api/test/_metrics/noop_instrument_test.cc similarity index 99% rename from api/test/metrics/noop_instrument_test.cc rename to api/test/_metrics/noop_instrument_test.cc index 0d0b9a07f5..83d8d3960e 100644 --- a/api/test/metrics/noop_instrument_test.cc +++ b/api/test/_metrics/noop_instrument_test.cc @@ -7,7 +7,7 @@ # include # include -# include "opentelemetry/metrics/noop.h" +# include "opentelemetry/_metrics/noop.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace metrics diff --git a/api/test/metrics/noop_metrics_test.cc b/api/test/_metrics/noop_metrics_test.cc similarity index 93% rename from api/test/metrics/noop_metrics_test.cc rename to api/test/_metrics/noop_metrics_test.cc index 14b3643c7b..cc9d1f4b76 100644 --- a/api/test/metrics/noop_metrics_test.cc +++ b/api/test/_metrics/noop_metrics_test.cc @@ -3,10 +3,10 @@ #ifdef ENABLE_METRICS_PREVIEW # include -# include "opentelemetry/metrics/instrument.h" -# include "opentelemetry/metrics/noop.h" -# include "opentelemetry/metrics/observer_result.h" -# include "opentelemetry/metrics/sync_instruments.h" +# include "opentelemetry/_metrics/instrument.h" +# include "opentelemetry/_metrics/noop.h" +# include "opentelemetry/_metrics/observer_result.h" +# include "opentelemetry/_metrics/sync_instruments.h" # include # include diff --git a/examples/metrics_simple/BUILD b/examples/metrics_simple/BUILD index 196614a96c..4eb3776934 100644 --- a/examples/metrics_simple/BUILD +++ b/examples/metrics_simple/BUILD @@ -6,7 +6,7 @@ cc_binary( linkopts = ["-pthread"], deps = [ "//api", - "//exporters/ostream:ostream_metrics_exporter", - "//sdk/src/metrics", + "//exporters/ostream:ostream_metrics_exporter_deprecated", + "//sdk/src/_metrics:metrics_deprecated", ], ) diff --git a/examples/metrics_simple/CMakeLists.txt b/examples/metrics_simple/CMakeLists.txt index 4269318871..94b441061b 100644 --- a/examples/metrics_simple/CMakeLists.txt +++ b/examples/metrics_simple/CMakeLists.txt @@ -2,5 +2,5 @@ include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include) add_executable(simple_metrics main.cc) target_link_libraries( - simple_metrics ${CMAKE_THREAD_LIBS_INIT} opentelemetry_metrics - opentelemetry_exporter_ostream_metrics) + simple_metrics ${CMAKE_THREAD_LIBS_INIT} opentelemetry_metrics_deprecated + opentelemetry_exporter_ostream_metrics_deprecated) diff --git a/examples/metrics_simple/main.cc b/examples/metrics_simple/main.cc index fe0e7df4bb..e2ab7f09f6 100644 --- a/examples/metrics_simple/main.cc +++ b/examples/metrics_simple/main.cc @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 #ifdef ENABLE_METRICS_PREVIEW +# include "opentelemetry/_metrics/provider.h" # include "opentelemetry/exporters/ostream/metrics_exporter.h" -# include "opentelemetry/metrics/provider.h" -# include "opentelemetry/sdk/metrics/controller.h" -# include "opentelemetry/sdk/metrics/meter.h" -# include "opentelemetry/sdk/metrics/meter_provider.h" -# include "opentelemetry/sdk/metrics/ungrouped_processor.h" +# include "opentelemetry/sdk/_metrics/controller.h" +# include "opentelemetry/sdk/_metrics/meter.h" +# include "opentelemetry/sdk/_metrics/meter_provider.h" +# include "opentelemetry/sdk/_metrics/ungrouped_processor.h" namespace sdkmetrics = opentelemetry::sdk::metrics; namespace nostd = opentelemetry::nostd; diff --git a/exporters/ostream/BUILD b/exporters/ostream/BUILD index d16e727b59..3f4e1ffaeb 100644 --- a/exporters/ostream/BUILD +++ b/exporters/ostream/BUILD @@ -24,7 +24,7 @@ cc_test( ) cc_library( - name = "ostream_metrics_exporter", + name = "ostream_metrics_exporter_deprecated", srcs = [ "src/metrics_exporter.cc", ], @@ -33,7 +33,7 @@ cc_library( ], strip_include_prefix = "include", deps = [ - "//sdk/src/metrics", + "//sdk/src/_metrics:metrics_deprecated", ], ) @@ -41,7 +41,7 @@ cc_test( name = "ostream_metrics_test", srcs = ["test/ostream_metrics_test.cc"], deps = [ - ":ostream_metrics_exporter", + ":ostream_metrics_exporter_deprecated", "@com_google_googletest//:gtest_main", ], ) diff --git a/exporters/ostream/CMakeLists.txt b/exporters/ostream/CMakeLists.txt index fbbf7b231d..e83719cce3 100644 --- a/exporters/ostream/CMakeLists.txt +++ b/exporters/ostream/CMakeLists.txt @@ -35,16 +35,17 @@ if(BUILD_TESTING) endif() # BUILD_TESTING if(WITH_METRICS_PREVIEW) - add_library(opentelemetry_exporter_ostream_metrics src/metrics_exporter.cc) - set_target_properties(opentelemetry_exporter_ostream_metrics + add_library(opentelemetry_exporter_ostream_metrics_deprecated + src/metrics_exporter.cc) + set_target_properties(opentelemetry_exporter_ostream_metrics_deprecated PROPERTIES EXPORT_NAME ostream_metrics_exporter) target_include_directories( - opentelemetry_exporter_ostream_metrics + opentelemetry_exporter_ostream_metrics_deprecated PUBLIC "$") - target_link_libraries(opentelemetry_exporter_ostream_metrics - PUBLIC opentelemetry_metrics) + target_link_libraries(opentelemetry_exporter_ostream_metrics_deprecated + PUBLIC opentelemetry_metrics_deprecated) install( - TARGETS opentelemetry_exporter_ostream_metrics + TARGETS opentelemetry_exporter_ostream_metrics_deprecated EXPORT "${PROJECT_NAME}-target" RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -56,7 +57,7 @@ if(WITH_METRICS_PREVIEW) if(BUILD_TESTING) add_executable(ostream_metrics_test test/ostream_metrics_test.cc) target_link_libraries(ostream_metrics_test ${GTEST_BOTH_LIBRARIES} - opentelemetry_exporter_ostream_metrics) + opentelemetry_exporter_ostream_metrics_deprecated) gtest_add_tests( TARGET ostream_metrics_test TEST_PREFIX exporter. diff --git a/exporters/ostream/include/opentelemetry/exporters/ostream/metrics_exporter.h b/exporters/ostream/include/opentelemetry/exporters/ostream/metrics_exporter.h index 469382b6bd..82eceb18e0 100644 --- a/exporters/ostream/include/opentelemetry/exporters/ostream/metrics_exporter.h +++ b/exporters/ostream/include/opentelemetry/exporters/ostream/metrics_exporter.h @@ -6,11 +6,11 @@ # include # include -# include "opentelemetry/sdk/metrics/aggregator/exact_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/gauge_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/histogram_aggregator.h" -# include "opentelemetry/sdk/metrics/exporter.h" -# include "opentelemetry/sdk/metrics/record.h" +# include "opentelemetry/sdk/_metrics/aggregator/exact_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/gauge_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/histogram_aggregator.h" +# include "opentelemetry/sdk/_metrics/exporter.h" +# include "opentelemetry/sdk/_metrics/record.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdkmetrics = opentelemetry::sdk::metrics; diff --git a/exporters/ostream/test/ostream_metrics_test.cc b/exporters/ostream/test/ostream_metrics_test.cc index d86a41b382..9a7c77216d 100644 --- a/exporters/ostream/test/ostream_metrics_test.cc +++ b/exporters/ostream/test/ostream_metrics_test.cc @@ -5,13 +5,13 @@ #ifdef ENABLE_METRICS_PREVIEW # include "opentelemetry/exporters/ostream/metrics_exporter.h" -# include "opentelemetry/sdk/metrics/aggregator/counter_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/exact_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/gauge_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/min_max_sum_count_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/sketch_aggregator.h" -# include "opentelemetry/sdk/metrics/exporter.h" -# include "opentelemetry/sdk/metrics/record.h" +# include "opentelemetry/sdk/_metrics/aggregator/counter_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/exact_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/gauge_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/min_max_sum_count_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/sketch_aggregator.h" +# include "opentelemetry/sdk/_metrics/exporter.h" +# include "opentelemetry/sdk/_metrics/record.h" # include diff --git a/exporters/prometheus/CMakeLists.txt b/exporters/prometheus/CMakeLists.txt index d6b8eefea5..6d3289243a 100644 --- a/exporters/prometheus/CMakeLists.txt +++ b/exporters/prometheus/CMakeLists.txt @@ -12,21 +12,23 @@ # See the License for the specific language governing permissions and # limitations under the License. +include_directories(include) find_package(prometheus-cpp CONFIG REQUIRED) -add_library(prometheus_exporter src/prometheus_collector.cc - src/prometheus_exporter_utils.cc) +add_library(prometheus_exporter_deprecated src/prometheus_collector.cc + src/prometheus_exporter_utils.cc) target_include_directories( - prometheus_exporter + prometheus_exporter_deprecated PUBLIC "$" "$") -target_link_libraries(prometheus_exporter PUBLIC opentelemetry_metrics - prometheus-cpp::core) +target_link_libraries( + prometheus_exporter_deprecated PUBLIC opentelemetry_metrics_deprecated + prometheus-cpp::core) install( - TARGETS prometheus_exporter + TARGETS prometheus_exporter_deprecated EXPORT "${PROJECT_NAME}-target" RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/exporters/prometheus/include/opentelemetry/exporters/prometheus/prometheus_collector.h b/exporters/prometheus/include/opentelemetry/exporters/prometheus/prometheus_collector.h index e1e6e74f4e..69d7754ad6 100644 --- a/exporters/prometheus/include/opentelemetry/exporters/prometheus/prometheus_collector.h +++ b/exporters/prometheus/include/opentelemetry/exporters/prometheus/prometheus_collector.h @@ -8,7 +8,7 @@ # include # include -# include "opentelemetry/sdk/metrics/record.h" +# include "opentelemetry/sdk/_metrics/record.h" # include "prometheus/collectable.h" # include "prometheus/metric_family.h" # include "prometheus_exporter_utils.h" diff --git a/exporters/prometheus/include/opentelemetry/exporters/prometheus/prometheus_exporter_utils.h b/exporters/prometheus/include/opentelemetry/exporters/prometheus/prometheus_exporter_utils.h index 30793725b4..a1fb3cd754 100644 --- a/exporters/prometheus/include/opentelemetry/exporters/prometheus/prometheus_exporter_utils.h +++ b/exporters/prometheus/include/opentelemetry/exporters/prometheus/prometheus_exporter_utils.h @@ -7,7 +7,7 @@ # include # include -# include "opentelemetry/sdk/metrics/record.h" +# include "opentelemetry/sdk/_metrics/record.h" # include "prometheus/metric_family.h" namespace metric_sdk = opentelemetry::sdk::metrics; diff --git a/exporters/prometheus/src/prometheus_exporter_utils.cc b/exporters/prometheus/src/prometheus_exporter_utils.cc index 846b6faff2..fcc4615c6b 100644 --- a/exporters/prometheus/src/prometheus_exporter_utils.cc +++ b/exporters/prometheus/src/prometheus_exporter_utils.cc @@ -8,7 +8,7 @@ # include # include "opentelemetry/exporters/prometheus/prometheus_exporter_utils.h" -# include "opentelemetry/sdk/metrics/aggregator/aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/aggregator.h" # include "prometheus/metric_type.h" namespace prometheus_client = ::prometheus; diff --git a/exporters/prometheus/test/CMakeLists.txt b/exporters/prometheus/test/CMakeLists.txt index 4168c6d3e4..11f0d2999d 100644 --- a/exporters/prometheus/test/CMakeLists.txt +++ b/exporters/prometheus/test/CMakeLists.txt @@ -2,7 +2,7 @@ foreach(testname prometheus_collector_test prometheus_exporter_utils_test) add_executable(${testname} "${testname}.cc") target_link_libraries( ${testname} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} - prometheus_exporter prometheus-cpp::pull) + prometheus_exporter_deprecated prometheus-cpp::pull) gtest_add_tests( TARGET ${testname} TEST_PREFIX exporter. diff --git a/exporters/prometheus/test/prometheus_collector_test.cc b/exporters/prometheus/test/prometheus_collector_test.cc index 662fbf4f3e..ef6c6023d8 100644 --- a/exporters/prometheus/test/prometheus_collector_test.cc +++ b/exporters/prometheus/test/prometheus_collector_test.cc @@ -7,16 +7,16 @@ # include # include +# include "opentelemetry/_metrics/instrument.h" # include "opentelemetry/exporters/prometheus/prometheus_collector.h" -# include "opentelemetry/metrics/instrument.h" -# include "opentelemetry/sdk/metrics/aggregator/aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/counter_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/exact_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/gauge_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/histogram_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/min_max_sum_count_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/sketch_aggregator.h" -# include "opentelemetry/sdk/metrics/record.h" +# include "opentelemetry/sdk/_metrics/aggregator/aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/counter_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/exact_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/gauge_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/histogram_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/min_max_sum_count_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/sketch_aggregator.h" +# include "opentelemetry/sdk/_metrics/record.h" # include "opentelemetry/version.h" using opentelemetry::exporter::prometheus::PrometheusCollector; diff --git a/exporters/prometheus/test/prometheus_exporter_utils_test.cc b/exporters/prometheus/test/prometheus_exporter_utils_test.cc index d48cb0f16b..22ce3f5fd7 100644 --- a/exporters/prometheus/test/prometheus_exporter_utils_test.cc +++ b/exporters/prometheus/test/prometheus_exporter_utils_test.cc @@ -10,12 +10,12 @@ # include # include "opentelemetry/exporters/prometheus/prometheus_exporter_utils.h" -# include "opentelemetry/sdk/metrics/aggregator/counter_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/exact_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/gauge_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/histogram_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/min_max_sum_count_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/sketch_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/counter_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/exact_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/gauge_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/histogram_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/min_max_sum_count_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/sketch_aggregator.h" using opentelemetry::exporter::prometheus::PrometheusExporterUtils; namespace metric_sdk = opentelemetry::sdk::metrics; diff --git a/sdk/CMakeLists.txt b/sdk/CMakeLists.txt index 3f217544d8..9aa45883e5 100644 --- a/sdk/CMakeLists.txt +++ b/sdk/CMakeLists.txt @@ -20,7 +20,7 @@ endif() set(METRICS_EXCLUDE_PATTERN "") if(NOT WITH_METRICS_PREVIEW) - set(METRICS_EXCLUDE_PATTERN "metrics") + set(METRICS_EXCLUDE_PATTERN "_metrics") endif() install( diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregator/aggregator.h b/sdk/include/opentelemetry/sdk/_metrics/aggregator/aggregator.h similarity index 98% rename from sdk/include/opentelemetry/sdk/metrics/aggregator/aggregator.h rename to sdk/include/opentelemetry/sdk/_metrics/aggregator/aggregator.h index 361b6bd19f..fb90256d76 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregator/aggregator.h +++ b/sdk/include/opentelemetry/sdk/_metrics/aggregator/aggregator.h @@ -6,8 +6,8 @@ # include # include +# include "opentelemetry/_metrics/instrument.h" # include "opentelemetry/common/timestamp.h" -# include "opentelemetry/metrics/instrument.h" # include "opentelemetry/version.h" namespace metrics_api = opentelemetry::metrics; diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregator/counter_aggregator.h b/sdk/include/opentelemetry/sdk/_metrics/aggregator/counter_aggregator.h similarity index 95% rename from sdk/include/opentelemetry/sdk/metrics/aggregator/counter_aggregator.h rename to sdk/include/opentelemetry/sdk/_metrics/aggregator/counter_aggregator.h index aa5e6bed04..2189dcc934 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregator/counter_aggregator.h +++ b/sdk/include/opentelemetry/sdk/_metrics/aggregator/counter_aggregator.h @@ -6,8 +6,8 @@ # include # include -# include "opentelemetry/metrics/instrument.h" -# include "opentelemetry/sdk/metrics/aggregator/aggregator.h" +# include "opentelemetry/_metrics/instrument.h" +# include "opentelemetry/sdk/_metrics/aggregator/aggregator.h" # include "opentelemetry/version.h" namespace metrics_api = opentelemetry::metrics; diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregator/exact_aggregator.h b/sdk/include/opentelemetry/sdk/_metrics/aggregator/exact_aggregator.h similarity index 97% rename from sdk/include/opentelemetry/sdk/metrics/aggregator/exact_aggregator.h rename to sdk/include/opentelemetry/sdk/_metrics/aggregator/exact_aggregator.h index d9853b54a9..cb4e52e71b 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregator/exact_aggregator.h +++ b/sdk/include/opentelemetry/sdk/_metrics/aggregator/exact_aggregator.h @@ -4,8 +4,8 @@ #pragma once #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/metrics/instrument.h" -# include "opentelemetry/sdk/metrics/aggregator/aggregator.h" +# include "opentelemetry/_metrics/instrument.h" +# include "opentelemetry/sdk/_metrics/aggregator/aggregator.h" # include "opentelemetry/version.h" # include diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregator/gauge_aggregator.h b/sdk/include/opentelemetry/sdk/_metrics/aggregator/gauge_aggregator.h similarity index 97% rename from sdk/include/opentelemetry/sdk/metrics/aggregator/gauge_aggregator.h rename to sdk/include/opentelemetry/sdk/_metrics/aggregator/gauge_aggregator.h index e953e8c619..e65702843c 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregator/gauge_aggregator.h +++ b/sdk/include/opentelemetry/sdk/_metrics/aggregator/gauge_aggregator.h @@ -4,9 +4,9 @@ #pragma once #ifdef ENABLE_METRICS_PREVIEW +# include "opentelemetry/_metrics/instrument.h" # include "opentelemetry/common/timestamp.h" -# include "opentelemetry/metrics/instrument.h" -# include "opentelemetry/sdk/metrics/aggregator/aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/aggregator.h" # include "opentelemetry/version.h" # include diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregator/histogram_aggregator.h b/sdk/include/opentelemetry/sdk/_metrics/aggregator/histogram_aggregator.h similarity index 98% rename from sdk/include/opentelemetry/sdk/metrics/aggregator/histogram_aggregator.h rename to sdk/include/opentelemetry/sdk/_metrics/aggregator/histogram_aggregator.h index 87372a43a8..31c501d96d 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregator/histogram_aggregator.h +++ b/sdk/include/opentelemetry/sdk/_metrics/aggregator/histogram_aggregator.h @@ -8,8 +8,8 @@ # include # include # include -# include "opentelemetry/metrics/instrument.h" -# include "opentelemetry/sdk/metrics/aggregator/aggregator.h" +# include "opentelemetry/_metrics/instrument.h" +# include "opentelemetry/sdk/_metrics/aggregator/aggregator.h" # include "opentelemetry/version.h" namespace metrics_api = opentelemetry::metrics; diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregator/min_max_sum_count_aggregator.h b/sdk/include/opentelemetry/sdk/_metrics/aggregator/min_max_sum_count_aggregator.h similarity index 97% rename from sdk/include/opentelemetry/sdk/metrics/aggregator/min_max_sum_count_aggregator.h rename to sdk/include/opentelemetry/sdk/_metrics/aggregator/min_max_sum_count_aggregator.h index 42dbfa367c..55699b208f 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregator/min_max_sum_count_aggregator.h +++ b/sdk/include/opentelemetry/sdk/_metrics/aggregator/min_max_sum_count_aggregator.h @@ -4,8 +4,8 @@ #pragma once #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/metrics/instrument.h" -# include "opentelemetry/sdk/metrics/aggregator/aggregator.h" +# include "opentelemetry/_metrics/instrument.h" +# include "opentelemetry/sdk/_metrics/aggregator/aggregator.h" # include "opentelemetry/version.h" # include diff --git a/sdk/include/opentelemetry/sdk/metrics/aggregator/sketch_aggregator.h b/sdk/include/opentelemetry/sdk/_metrics/aggregator/sketch_aggregator.h similarity index 98% rename from sdk/include/opentelemetry/sdk/metrics/aggregator/sketch_aggregator.h rename to sdk/include/opentelemetry/sdk/_metrics/aggregator/sketch_aggregator.h index 27f8c46f9a..6fbd502240 100644 --- a/sdk/include/opentelemetry/sdk/metrics/aggregator/sketch_aggregator.h +++ b/sdk/include/opentelemetry/sdk/_metrics/aggregator/sketch_aggregator.h @@ -11,8 +11,8 @@ # include # include # include -# include "opentelemetry/metrics/instrument.h" -# include "opentelemetry/sdk/metrics/aggregator/aggregator.h" +# include "opentelemetry/_metrics/instrument.h" +# include "opentelemetry/sdk/_metrics/aggregator/aggregator.h" # include "opentelemetry/version.h" namespace metrics_api = opentelemetry::metrics; diff --git a/sdk/include/opentelemetry/sdk/metrics/async_instruments.h b/sdk/include/opentelemetry/sdk/_metrics/async_instruments.h similarity index 96% rename from sdk/include/opentelemetry/sdk/metrics/async_instruments.h rename to sdk/include/opentelemetry/sdk/_metrics/async_instruments.h index bacb4d74c5..09ff75bfb5 100644 --- a/sdk/include/opentelemetry/sdk/metrics/async_instruments.h +++ b/sdk/include/opentelemetry/sdk/_metrics/async_instruments.h @@ -9,10 +9,10 @@ # include # include # include -# include "opentelemetry/metrics/async_instruments.h" -# include "opentelemetry/sdk/metrics/aggregator/counter_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/min_max_sum_count_aggregator.h" -# include "opentelemetry/sdk/metrics/instrument.h" +# include "opentelemetry/_metrics/async_instruments.h" +# include "opentelemetry/sdk/_metrics/aggregator/counter_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/min_max_sum_count_aggregator.h" +# include "opentelemetry/sdk/_metrics/instrument.h" # include "opentelemetry/version.h" namespace metrics_api = opentelemetry::metrics; diff --git a/sdk/include/opentelemetry/sdk/metrics/controller.h b/sdk/include/opentelemetry/sdk/_metrics/controller.h similarity index 93% rename from sdk/include/opentelemetry/sdk/metrics/controller.h rename to sdk/include/opentelemetry/sdk/_metrics/controller.h index 8161ffad03..f0cb1fc841 100644 --- a/sdk/include/opentelemetry/sdk/metrics/controller.h +++ b/sdk/include/opentelemetry/sdk/_metrics/controller.h @@ -9,12 +9,12 @@ # include # include # include -# include "opentelemetry/metrics/instrument.h" +# include "opentelemetry/_metrics/instrument.h" # include "opentelemetry/nostd/unique_ptr.h" -# include "opentelemetry/sdk/metrics/exporter.h" -# include "opentelemetry/sdk/metrics/meter.h" -# include "opentelemetry/sdk/metrics/processor.h" -# include "opentelemetry/sdk/metrics/record.h" +# include "opentelemetry/sdk/_metrics/exporter.h" +# include "opentelemetry/sdk/_metrics/meter.h" +# include "opentelemetry/sdk/_metrics/processor.h" +# include "opentelemetry/sdk/_metrics/record.h" # include "opentelemetry/version.h" namespace metrics_api = opentelemetry::metrics; diff --git a/sdk/include/opentelemetry/sdk/metrics/exporter.h b/sdk/include/opentelemetry/sdk/_metrics/exporter.h similarity index 94% rename from sdk/include/opentelemetry/sdk/metrics/exporter.h rename to sdk/include/opentelemetry/sdk/_metrics/exporter.h index 05e28eda23..aae416527f 100644 --- a/sdk/include/opentelemetry/sdk/metrics/exporter.h +++ b/sdk/include/opentelemetry/sdk/_metrics/exporter.h @@ -5,8 +5,8 @@ #ifdef ENABLE_METRICS_PREVIEW # include +# include "opentelemetry/sdk/_metrics/record.h" # include "opentelemetry/sdk/common/exporter_utils.h" -# include "opentelemetry/sdk/metrics/record.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/include/opentelemetry/sdk/metrics/instrument.h b/sdk/include/opentelemetry/sdk/_metrics/instrument.h similarity index 98% rename from sdk/include/opentelemetry/sdk/metrics/instrument.h rename to sdk/include/opentelemetry/sdk/_metrics/instrument.h index 62707e17e7..b69b550fdc 100644 --- a/sdk/include/opentelemetry/sdk/metrics/instrument.h +++ b/sdk/include/opentelemetry/sdk/_metrics/instrument.h @@ -11,9 +11,9 @@ # include # include # include -# include "opentelemetry/metrics/instrument.h" -# include "opentelemetry/sdk/metrics/aggregator/aggregator.h" -# include "opentelemetry/sdk/metrics/record.h" +# include "opentelemetry/_metrics/instrument.h" +# include "opentelemetry/sdk/_metrics/aggregator/aggregator.h" +# include "opentelemetry/sdk/_metrics/record.h" # include "opentelemetry/version.h" namespace metrics_api = opentelemetry::metrics; diff --git a/sdk/include/opentelemetry/sdk/metrics/meter.h b/sdk/include/opentelemetry/sdk/_metrics/meter.h similarity index 98% rename from sdk/include/opentelemetry/sdk/metrics/meter.h rename to sdk/include/opentelemetry/sdk/_metrics/meter.h index a770584cd3..a045ab93b1 100644 --- a/sdk/include/opentelemetry/sdk/metrics/meter.h +++ b/sdk/include/opentelemetry/sdk/_metrics/meter.h @@ -4,12 +4,12 @@ #pragma once #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/metrics/meter.h" +# include "opentelemetry/_metrics/meter.h" # include "opentelemetry/nostd/shared_ptr.h" -# include "opentelemetry/sdk/metrics/async_instruments.h" -# include "opentelemetry/sdk/metrics/instrument.h" -# include "opentelemetry/sdk/metrics/record.h" -# include "opentelemetry/sdk/metrics/sync_instruments.h" +# include "opentelemetry/sdk/_metrics/async_instruments.h" +# include "opentelemetry/sdk/_metrics/instrument.h" +# include "opentelemetry/sdk/_metrics/record.h" +# include "opentelemetry/sdk/_metrics/sync_instruments.h" # include # include diff --git a/sdk/include/opentelemetry/sdk/metrics/meter_provider.h b/sdk/include/opentelemetry/sdk/_metrics/meter_provider.h similarity index 89% rename from sdk/include/opentelemetry/sdk/metrics/meter_provider.h rename to sdk/include/opentelemetry/sdk/_metrics/meter_provider.h index 59c180bda0..da218ceacd 100644 --- a/sdk/include/opentelemetry/sdk/metrics/meter_provider.h +++ b/sdk/include/opentelemetry/sdk/_metrics/meter_provider.h @@ -4,9 +4,9 @@ #pragma once #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/metrics/meter_provider.h" +# include "opentelemetry/_metrics/meter_provider.h" # include "opentelemetry/nostd/shared_ptr.h" -# include "opentelemetry/sdk/metrics/meter.h" +# include "opentelemetry/sdk/_metrics/meter.h" # include # include diff --git a/sdk/include/opentelemetry/sdk/metrics/processor.h b/sdk/include/opentelemetry/sdk/_metrics/processor.h similarity index 88% rename from sdk/include/opentelemetry/sdk/metrics/processor.h rename to sdk/include/opentelemetry/sdk/_metrics/processor.h index 94822a3e60..b37d63c5fa 100644 --- a/sdk/include/opentelemetry/sdk/metrics/processor.h +++ b/sdk/include/opentelemetry/sdk/_metrics/processor.h @@ -3,9 +3,9 @@ #pragma once #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/metrics/instrument.h" +# include "opentelemetry/_metrics/instrument.h" # include "opentelemetry/nostd/string_view.h" -# include "opentelemetry/sdk/metrics/record.h" +# include "opentelemetry/sdk/_metrics/record.h" # include "opentelemetry/version.h" # include diff --git a/sdk/include/opentelemetry/sdk/metrics/record.h b/sdk/include/opentelemetry/sdk/_metrics/record.h similarity index 92% rename from sdk/include/opentelemetry/sdk/metrics/record.h rename to sdk/include/opentelemetry/sdk/_metrics/record.h index d51349bd05..02d61b7116 100644 --- a/sdk/include/opentelemetry/sdk/metrics/record.h +++ b/sdk/include/opentelemetry/sdk/_metrics/record.h @@ -5,9 +5,9 @@ #ifdef ENABLE_METRICS_PREVIEW # include -# include "opentelemetry/metrics/instrument.h" +# include "opentelemetry/_metrics/instrument.h" # include "opentelemetry/nostd/variant.h" -# include "opentelemetry/sdk/metrics/aggregator/aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/aggregator.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h b/sdk/include/opentelemetry/sdk/_metrics/sync_instruments.h similarity index 98% rename from sdk/include/opentelemetry/sdk/metrics/sync_instruments.h rename to sdk/include/opentelemetry/sdk/_metrics/sync_instruments.h index 0c1bd1a245..55890f44f0 100644 --- a/sdk/include/opentelemetry/sdk/metrics/sync_instruments.h +++ b/sdk/include/opentelemetry/sdk/_metrics/sync_instruments.h @@ -9,10 +9,10 @@ # include # include # include -# include "opentelemetry/metrics/sync_instruments.h" -# include "opentelemetry/sdk/metrics/aggregator/counter_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/min_max_sum_count_aggregator.h" -# include "opentelemetry/sdk/metrics/instrument.h" +# include "opentelemetry/_metrics/sync_instruments.h" +# include "opentelemetry/sdk/_metrics/aggregator/counter_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/min_max_sum_count_aggregator.h" +# include "opentelemetry/sdk/_metrics/instrument.h" namespace metrics_api = opentelemetry::metrics; diff --git a/sdk/include/opentelemetry/sdk/metrics/ungrouped_processor.h b/sdk/include/opentelemetry/sdk/_metrics/ungrouped_processor.h similarity index 95% rename from sdk/include/opentelemetry/sdk/metrics/ungrouped_processor.h rename to sdk/include/opentelemetry/sdk/_metrics/ungrouped_processor.h index 4441015d5b..2a12be4270 100644 --- a/sdk/include/opentelemetry/sdk/metrics/ungrouped_processor.h +++ b/sdk/include/opentelemetry/sdk/_metrics/ungrouped_processor.h @@ -5,14 +5,14 @@ #ifdef ENABLE_METRICS_PREVIEW # include -# include "opentelemetry/sdk/metrics/aggregator/counter_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/exact_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/gauge_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/histogram_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/min_max_sum_count_aggregator.h" -# include "opentelemetry/sdk/metrics/aggregator/sketch_aggregator.h" -# include "opentelemetry/sdk/metrics/processor.h" -# include "opentelemetry/sdk/metrics/record.h" +# include "opentelemetry/sdk/_metrics/aggregator/counter_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/exact_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/gauge_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/histogram_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/min_max_sum_count_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/sketch_aggregator.h" +# include "opentelemetry/sdk/_metrics/processor.h" +# include "opentelemetry/sdk/_metrics/record.h" # include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/src/CMakeLists.txt b/sdk/src/CMakeLists.txt index 2261454239..1c868a1bf4 100644 --- a/sdk/src/CMakeLists.txt +++ b/sdk/src/CMakeLists.txt @@ -1,7 +1,7 @@ add_subdirectory(common) add_subdirectory(trace) if(WITH_METRICS_PREVIEW) - add_subdirectory(metrics) + add_subdirectory(_metrics) endif() if(WITH_LOGS_PREVIEW) add_subdirectory(logs) diff --git a/sdk/src/metrics/BUILD b/sdk/src/_metrics/BUILD similarity index 91% rename from sdk/src/metrics/BUILD rename to sdk/src/_metrics/BUILD index 8843706817..4b528dda77 100644 --- a/sdk/src/metrics/BUILD +++ b/sdk/src/_metrics/BUILD @@ -15,10 +15,10 @@ package(default_visibility = ["//visibility:public"]) cc_library( - name = "metrics", + name = "metrics_deprecated", srcs = glob(["**/*.cc"]), hdrs = glob(["**/*.h"]), - include_prefix = "src/metrics", + include_prefix = "src/_metrics", deps = [ "//api", "//sdk:headers", diff --git a/sdk/src/_metrics/CMakeLists.txt b/sdk/src/_metrics/CMakeLists.txt new file mode 100644 index 0000000000..c1717ce892 --- /dev/null +++ b/sdk/src/_metrics/CMakeLists.txt @@ -0,0 +1,19 @@ +add_library(opentelemetry_metrics_deprecated meter_provider.cc meter.cc + ungrouped_processor.cc) + +set_target_properties(opentelemetry_metrics_deprecated + PROPERTIES EXPORT_NAME metrics_deprecated) + +target_link_libraries(opentelemetry_metrics_deprecated + PUBLIC opentelemetry_common) + +target_include_directories( + opentelemetry_metrics_deprecated + PUBLIC "$") + +install( + TARGETS opentelemetry_metrics_deprecated + EXPORT "${PROJECT_NAME}-target" + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/sdk/src/metrics/meter.cc b/sdk/src/_metrics/meter.cc similarity index 99% rename from sdk/src/metrics/meter.cc rename to sdk/src/_metrics/meter.cc index 13e73cbc9e..be5d094022 100644 --- a/sdk/src/metrics/meter.cc +++ b/sdk/src/_metrics/meter.cc @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/sdk/metrics/meter.h" +# include "opentelemetry/sdk/_metrics/meter.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk { diff --git a/sdk/src/metrics/meter_provider.cc b/sdk/src/_metrics/meter_provider.cc similarity index 92% rename from sdk/src/metrics/meter_provider.cc rename to sdk/src/_metrics/meter_provider.cc index 903ba76e06..e3da4b686e 100644 --- a/sdk/src/metrics/meter_provider.cc +++ b/sdk/src/_metrics/meter_provider.cc @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/sdk/metrics/meter_provider.h" +# include "opentelemetry/sdk/_metrics/meter_provider.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk diff --git a/sdk/src/metrics/ungrouped_processor.cc b/sdk/src/_metrics/ungrouped_processor.cc similarity index 98% rename from sdk/src/metrics/ungrouped_processor.cc rename to sdk/src/_metrics/ungrouped_processor.cc index c36cac2ca5..6d3598b59c 100644 --- a/sdk/src/metrics/ungrouped_processor.cc +++ b/sdk/src/_metrics/ungrouped_processor.cc @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/sdk/metrics/ungrouped_processor.h" +# include "opentelemetry/sdk/_metrics/ungrouped_processor.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/src/metrics/CMakeLists.txt b/sdk/src/metrics/CMakeLists.txt deleted file mode 100644 index 7ff562b588..0000000000 --- a/sdk/src/metrics/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -add_library(opentelemetry_metrics meter_provider.cc meter.cc - ungrouped_processor.cc) - -set_target_properties(opentelemetry_metrics PROPERTIES EXPORT_NAME metrics) - -target_link_libraries(opentelemetry_metrics PUBLIC opentelemetry_common) - -target_include_directories( - opentelemetry_metrics - PUBLIC "$") - -install( - TARGETS opentelemetry_metrics - EXPORT "${PROJECT_NAME}-target" - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/sdk/test/CMakeLists.txt b/sdk/test/CMakeLists.txt index 6c9955d23d..445568665a 100644 --- a/sdk/test/CMakeLists.txt +++ b/sdk/test/CMakeLists.txt @@ -1,7 +1,7 @@ add_subdirectory(common) add_subdirectory(trace) if(WITH_METRICS_PREVIEW) - add_subdirectory(metrics) + add_subdirectory(_metrics) endif() if(WITH_LOGS_PREVIEW) add_subdirectory(logs) diff --git a/sdk/test/metrics/BUILD b/sdk/test/_metrics/BUILD similarity index 75% rename from sdk/test/metrics/BUILD rename to sdk/test/_metrics/BUILD index cebe041aff..5118e1074e 100644 --- a/sdk/test/metrics/BUILD +++ b/sdk/test/_metrics/BUILD @@ -4,8 +4,8 @@ cc_test( "controller_test.cc", ], deps = [ - "//exporters/ostream:ostream_metrics_exporter", - "//sdk/src/metrics", + "//exporters/ostream:ostream_metrics_exporter_deprecated", + "//sdk/src/_metrics:metrics_deprecated", "@com_google_googletest//:gtest_main", ], ) @@ -16,7 +16,7 @@ cc_test( "gauge_aggregator_test.cc", ], deps = [ - "//sdk/src/metrics", + "//sdk/src/_metrics:metrics_deprecated", "@com_google_googletest//:gtest_main", ], ) @@ -27,7 +27,7 @@ cc_test( "min_max_sum_count_aggregator_test.cc", ], deps = [ - "//sdk/src/metrics", + "//sdk/src/_metrics:metrics_deprecated", "@com_google_googletest//:gtest_main", ], ) @@ -38,7 +38,7 @@ cc_test( "meter_provider_sdk_test.cc", ], deps = [ - "//sdk/src/metrics", + "//sdk/src/_metrics:metrics_deprecated", "@com_google_googletest//:gtest_main", ], ) @@ -49,7 +49,7 @@ cc_test( "meter_test.cc", ], deps = [ - "//sdk/src/metrics", + "//sdk/src/_metrics:metrics_deprecated", "@com_google_googletest//:gtest_main", ], ) @@ -60,7 +60,7 @@ cc_test( "counter_aggregator_test.cc", ], deps = [ - "//sdk/src/metrics", + "//sdk/src/_metrics:metrics_deprecated", "@com_google_googletest//:gtest_main", ], ) @@ -71,7 +71,7 @@ cc_test( "exact_aggregator_test.cc", ], deps = [ - "//sdk/src/metrics", + "//sdk/src/_metrics:metrics_deprecated", "@com_google_googletest//:gtest_main", ], ) @@ -82,7 +82,7 @@ cc_test( "histogram_aggregator_test.cc", ], deps = [ - "//sdk/src/metrics", + "//sdk/src/_metrics:metrics_deprecated", "@com_google_googletest//:gtest_main", ], ) @@ -93,7 +93,7 @@ cc_test( "metric_instrument_test.cc", ], deps = [ - "//sdk/src/metrics", + "//sdk/src/_metrics:metrics_deprecated", "@com_google_googletest//:gtest_main", ], ) @@ -104,7 +104,7 @@ cc_test( "sketch_aggregator_test.cc", ], deps = [ - "//sdk/src/metrics", + "//sdk/src/_metrics:metrics_deprecated", "@com_google_googletest//:gtest_main", ], ) @@ -115,7 +115,7 @@ cc_test( "ungrouped_processor_test.cc", ], deps = [ - "//sdk/src/metrics", + "//sdk/src/_metrics:metrics_deprecated", "@com_google_googletest//:gtest_main", ], ) diff --git a/sdk/test/metrics/CMakeLists.txt b/sdk/test/_metrics/CMakeLists.txt similarity index 76% rename from sdk/test/metrics/CMakeLists.txt rename to sdk/test/_metrics/CMakeLists.txt index a33ccbf64b..5d950ffb3f 100644 --- a/sdk/test/metrics/CMakeLists.txt +++ b/sdk/test/_metrics/CMakeLists.txt @@ -11,8 +11,9 @@ foreach( metric_instrument_test controller_test) add_executable(${testname} "${testname}.cc") - target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT} opentelemetry_metrics) + target_link_libraries( + ${testname} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} + opentelemetry_metrics_deprecated) gtest_add_tests( TARGET ${testname} TEST_PREFIX metrics. diff --git a/sdk/test/metrics/controller_test.cc b/sdk/test/_metrics/controller_test.cc similarity index 89% rename from sdk/test/metrics/controller_test.cc rename to sdk/test/_metrics/controller_test.cc index b90f1d1bcc..aa92c8d040 100644 --- a/sdk/test/metrics/controller_test.cc +++ b/sdk/test/_metrics/controller_test.cc @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/sdk/metrics/controller.h" -# include "opentelemetry/sdk/metrics/meter.h" -# include "opentelemetry/sdk/metrics/ungrouped_processor.h" +# include "opentelemetry/sdk/_metrics/controller.h" +# include "opentelemetry/sdk/_metrics/meter.h" +# include "opentelemetry/sdk/_metrics/ungrouped_processor.h" # include # include diff --git a/sdk/test/metrics/counter_aggregator_test.cc b/sdk/test/_metrics/counter_aggregator_test.cc similarity index 97% rename from sdk/test/metrics/counter_aggregator_test.cc rename to sdk/test/_metrics/counter_aggregator_test.cc index fe3ab7e036..7ef452e770 100644 --- a/sdk/test/metrics/counter_aggregator_test.cc +++ b/sdk/test/_metrics/counter_aggregator_test.cc @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/sdk/metrics/aggregator/counter_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/counter_aggregator.h" # include # include diff --git a/sdk/test/metrics/exact_aggregator_test.cc b/sdk/test/_metrics/exact_aggregator_test.cc similarity index 98% rename from sdk/test/metrics/exact_aggregator_test.cc rename to sdk/test/_metrics/exact_aggregator_test.cc index 88ce1a4432..cea9dda535 100644 --- a/sdk/test/metrics/exact_aggregator_test.cc +++ b/sdk/test/_metrics/exact_aggregator_test.cc @@ -6,7 +6,7 @@ #ifdef ENABLE_METRICS_PREVIEW # include -# include "opentelemetry/sdk/metrics/aggregator/exact_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/exact_aggregator.h" using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/gauge_aggregator_test.cc b/sdk/test/_metrics/gauge_aggregator_test.cc similarity index 98% rename from sdk/test/metrics/gauge_aggregator_test.cc rename to sdk/test/_metrics/gauge_aggregator_test.cc index b2721b8b51..fb323c33ab 100644 --- a/sdk/test/metrics/gauge_aggregator_test.cc +++ b/sdk/test/_metrics/gauge_aggregator_test.cc @@ -5,7 +5,7 @@ # include # include -# include "opentelemetry/sdk/metrics/aggregator/gauge_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/gauge_aggregator.h" using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/histogram_aggregator_test.cc b/sdk/test/_metrics/histogram_aggregator_test.cc similarity index 98% rename from sdk/test/metrics/histogram_aggregator_test.cc rename to sdk/test/_metrics/histogram_aggregator_test.cc index eec00e8360..daf920aa73 100644 --- a/sdk/test/metrics/histogram_aggregator_test.cc +++ b/sdk/test/_metrics/histogram_aggregator_test.cc @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/sdk/metrics/aggregator/histogram_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/histogram_aggregator.h" # include # include diff --git a/sdk/test/metrics/meter_provider_sdk_test.cc b/sdk/test/_metrics/meter_provider_sdk_test.cc similarity index 83% rename from sdk/test/metrics/meter_provider_sdk_test.cc rename to sdk/test/_metrics/meter_provider_sdk_test.cc index 459fbabd8f..2181bb62a2 100644 --- a/sdk/test/metrics/meter_provider_sdk_test.cc +++ b/sdk/test/_metrics/meter_provider_sdk_test.cc @@ -4,8 +4,8 @@ #ifdef ENABLE_METRICS_PREVIEW # include -# include "opentelemetry/sdk/metrics/meter.h" -# include "opentelemetry/sdk/metrics/meter_provider.h" +# include "opentelemetry/sdk/_metrics/meter.h" +# include "opentelemetry/sdk/_metrics/meter_provider.h" using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/meter_test.cc b/sdk/test/_metrics/meter_test.cc similarity index 99% rename from sdk/test/metrics/meter_test.cc rename to sdk/test/_metrics/meter_test.cc index 3c708fca92..4ee44e6b9b 100644 --- a/sdk/test/metrics/meter_test.cc +++ b/sdk/test/_metrics/meter_test.cc @@ -5,7 +5,7 @@ # include # include -# include "opentelemetry/sdk/metrics/meter.h" +# include "opentelemetry/sdk/_metrics/meter.h" using namespace opentelemetry::sdk::metrics; namespace metrics_api = opentelemetry::metrics; diff --git a/sdk/test/metrics/metric_instrument_test.cc b/sdk/test/_metrics/metric_instrument_test.cc similarity index 99% rename from sdk/test/metrics/metric_instrument_test.cc rename to sdk/test/_metrics/metric_instrument_test.cc index 461d3603f7..089baf1211 100644 --- a/sdk/test/metrics/metric_instrument_test.cc +++ b/sdk/test/_metrics/metric_instrument_test.cc @@ -9,8 +9,8 @@ # include # include # include -# include "opentelemetry/sdk/metrics/async_instruments.h" -# include "opentelemetry/sdk/metrics/sync_instruments.h" +# include "opentelemetry/sdk/_metrics/async_instruments.h" +# include "opentelemetry/sdk/_metrics/sync_instruments.h" namespace metrics_api = opentelemetry::metrics; diff --git a/sdk/test/metrics/min_max_sum_count_aggregator_test.cc b/sdk/test/_metrics/min_max_sum_count_aggregator_test.cc similarity index 98% rename from sdk/test/metrics/min_max_sum_count_aggregator_test.cc rename to sdk/test/_metrics/min_max_sum_count_aggregator_test.cc index 62b2b6763d..c73ea9aedb 100644 --- a/sdk/test/metrics/min_max_sum_count_aggregator_test.cc +++ b/sdk/test/_metrics/min_max_sum_count_aggregator_test.cc @@ -5,7 +5,7 @@ # include # include -# include "opentelemetry/sdk/metrics/aggregator/min_max_sum_count_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/min_max_sum_count_aggregator.h" using namespace opentelemetry::sdk::metrics; diff --git a/sdk/test/metrics/sketch_aggregator_test.cc b/sdk/test/_metrics/sketch_aggregator_test.cc similarity index 98% rename from sdk/test/metrics/sketch_aggregator_test.cc rename to sdk/test/_metrics/sketch_aggregator_test.cc index c17900e0a6..6dc2fbef38 100644 --- a/sdk/test/metrics/sketch_aggregator_test.cc +++ b/sdk/test/_metrics/sketch_aggregator_test.cc @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/sdk/metrics/aggregator/sketch_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/sketch_aggregator.h" # include # include diff --git a/sdk/test/metrics/ungrouped_processor_test.cc b/sdk/test/_metrics/ungrouped_processor_test.cc similarity index 99% rename from sdk/test/metrics/ungrouped_processor_test.cc rename to sdk/test/_metrics/ungrouped_processor_test.cc index 6bfbd0cde3..cfa06e6b06 100644 --- a/sdk/test/metrics/ungrouped_processor_test.cc +++ b/sdk/test/_metrics/ungrouped_processor_test.cc @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 #ifdef ENABLE_METRICS_PREVIEW -# include "opentelemetry/sdk/metrics/ungrouped_processor.h" +# include "opentelemetry/sdk/_metrics/ungrouped_processor.h" # include # include "opentelemetry/nostd/shared_ptr.h" -# include "opentelemetry/sdk/metrics/aggregator/counter_aggregator.h" +# include "opentelemetry/sdk/_metrics/aggregator/counter_aggregator.h" namespace sdkmetrics = opentelemetry::sdk::metrics; namespace metrics_api = opentelemetry::metrics;