File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,9 +18,7 @@ endif()
1818add_subdirectory (plugin )
1919add_subdirectory (simple )
2020add_subdirectory (batch )
21- if (WITH_METRICS_PREVIEW)
22- add_subdirectory (metrics_simple )
23- endif ()
21+ add_subdirectory (metrics_simple )
2422add_subdirectory (multithreaded )
2523add_subdirectory (multi_processor )
2624add_subdirectory (http )
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ add_subdirectory(foo_library)
22if (WITH_LOGS_PREVIEW)
33 add_subdirectory (logs_foo_library )
44endif ()
5+ add_subdirectory (metrics_foo_library )
Original file line number Diff line number Diff line change 1+ add_library (common_metrics_foo_library foo_library.h foo_library.cc )
2+ target_link_libraries (common_metrics_foo_library PUBLIC opentelemetry_api )
Original file line number Diff line number Diff line change 11include_directories (${CMAKE_SOURCE_DIR} /exporters/ostream/include )
2-
3- add_executable (simple_metrics main.cc )
4- target_link_libraries (
5- simple_metrics ${CMAKE_THREAD_LIBS_INIT} opentelemetry_metrics_deprecated
6- opentelemetry_exporter_ostream_metrics_deprecated )
2+ if (WITH_METRICS_PREVIEW)
3+ add_executable (simple_metrics main.cc )
4+ target_link_libraries (
5+ simple_metrics ${CMAKE_THREAD_LIBS_INIT} opentelemetry_metrics_deprecated
6+ opentelemetry_exporter_ostream_metrics_deprecated )
7+ else ()
8+ add_executable (metrics_ostream_example metrics_ostream.cc )
9+ target_link_libraries (
10+ metrics_ostream_example ${CMAKE_THREAD_LIBS_INIT} opentelemetry_metrics
11+ opentelemetry_exporter_ostream_metrics opentelemetry_resources
12+ common_metrics_foo_library )
13+ endif ()
Original file line number Diff line number Diff line change @@ -63,6 +63,35 @@ if(WITH_METRICS_PREVIEW)
6363 TEST_PREFIX exporter.
6464 TEST_LIST ostream_metrics_test )
6565 endif ()
66+ else ()
67+ add_library (opentelemetry_exporter_ostream_metrics src/metric_exporter.cc )
68+ set_target_properties (opentelemetry_exporter_ostream_metrics
69+ PROPERTIES EXPORT_NAME ostream_metrics_exporter )
70+ target_include_directories (
71+ opentelemetry_exporter_ostream_metrics
72+ PUBLIC "$<BUILD_INTERFACE :${CMAKE_CURRENT_LIST_DIR} /include >" )
73+ target_link_libraries (opentelemetry_exporter_ostream_metrics
74+ PUBLIC opentelemetry_metrics )
75+ install (
76+ TARGETS opentelemetry_exporter_ostream_metrics
77+ EXPORT "${PROJECT_NAME} -target"
78+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
79+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
80+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
81+ install (
82+ DIRECTORY include/opentelemetry/exporters/ostream
83+ DESTINATION include/opentelemetry/exporters
84+ PATTERN "metric_exporter.h" )
85+ if (BUILD_TESTING)
86+ add_executable (ostream_metric_test test /ostream_metric_test.cc )
87+ target_link_libraries (
88+ ostream_metric_test ${GTEST_BOTH_LIBRARIES}
89+ opentelemetry_exporter_ostream_metrics opentelemetry_resources )
90+ gtest_add_tests (
91+ TARGET ostream_metric_test
92+ TEST_PREFIX exporter.
93+ TEST_LIST ostream_metric_test )
94+ endif ()
6695endif ()
6796
6897if (WITH_LOGS_PREVIEW)
You can’t perform that action at this time.
0 commit comments