From 389b84f4303f728c97dcf8194f76277488e18cf4 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Sat, 12 Nov 2022 14:24:28 -0800 Subject: [PATCH] [Metrics SDK] Change Prometheus CMake target name (#1765) --- examples/prometheus/CMakeLists.txt | 3 ++- exporters/prometheus/CMakeLists.txt | 12 ++++++------ exporters/prometheus/test/CMakeLists.txt | 3 ++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/examples/prometheus/CMakeLists.txt b/examples/prometheus/CMakeLists.txt index b377920dee..bee3e7f782 100644 --- a/examples/prometheus/CMakeLists.txt +++ b/examples/prometheus/CMakeLists.txt @@ -2,4 +2,5 @@ include_directories(${CMAKE_SOURCE_DIR}/exporters/prometheus/include) add_executable(prometheus_example main.cc) target_link_libraries( prometheus_example ${CMAKE_THREAD_LIBS_INIT} opentelemetry_metrics - prometheus_exporter opentelemetry_resources common_metrics_foo_library) + opentelemetry_exporter_prometheus opentelemetry_resources + common_metrics_foo_library) diff --git a/exporters/prometheus/CMakeLists.txt b/exporters/prometheus/CMakeLists.txt index 7c7cbf5444..bdafeb1588 100644 --- a/exporters/prometheus/CMakeLists.txt +++ b/exporters/prometheus/CMakeLists.txt @@ -17,14 +17,14 @@ if(NOT TARGET prometheus-cpp::core) find_package(prometheus-cpp CONFIG REQUIRED) endif() -add_library(prometheus_exporter src/exporter.cc src/collector.cc - src/exporter_utils.cc) +add_library(opentelemetry_exporter_prometheus src/exporter.cc src/collector.cc + src/exporter_utils.cc) target_include_directories( - prometheus_exporter + opentelemetry_exporter_prometheus PUBLIC "$" "$") -set(PROMETHEUS_EXPORTER_TARGETS prometheus_exporter) +set(PROMETHEUS_EXPORTER_TARGETS opentelemetry_exporter_prometheus) if(TARGET pull) list(APPEND PROMETHEUS_EXPORTER_TARGETS pull) endif() @@ -32,8 +32,8 @@ if(TARGET core) list(APPEND PROMETHEUS_EXPORTER_TARGETS core) endif() target_link_libraries( - prometheus_exporter PUBLIC opentelemetry_metrics prometheus-cpp::pull - prometheus-cpp::core) + opentelemetry_exporter_prometheus + PUBLIC opentelemetry_metrics prometheus-cpp::pull prometheus-cpp::core) install( TARGETS ${PROMETHEUS_EXPORTER_TARGETS} EXPORT "${PROJECT_NAME}-target" diff --git a/exporters/prometheus/test/CMakeLists.txt b/exporters/prometheus/test/CMakeLists.txt index a954357488..3180c00e0c 100644 --- a/exporters/prometheus/test/CMakeLists.txt +++ b/exporters/prometheus/test/CMakeLists.txt @@ -2,7 +2,8 @@ foreach(testname exporter_test collector_test exporter_utils_test) add_executable(${testname} "${testname}.cc") target_link_libraries( ${testname} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} - prometheus_exporter prometheus-cpp::pull opentelemetry_resources) + opentelemetry_exporter_prometheus prometheus-cpp::pull + opentelemetry_resources) gtest_add_tests( TARGET ${testname} TEST_PREFIX exporter.