Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Metrics SDK] Change Prometheus CMake target name #1765

Merged
merged 3 commits into from
Nov 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/prometheus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 6 additions & 6 deletions exporters/prometheus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ 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 "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
"$<INSTALL_INTERFACE:include>")

set(PROMETHEUS_EXPORTER_TARGETS prometheus_exporter)
set(PROMETHEUS_EXPORTER_TARGETS opentelemetry_exporter_prometheus)
if(TARGET pull)
list(APPEND PROMETHEUS_EXPORTER_TARGETS pull)
endif()
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"
Expand Down
3 changes: 2 additions & 1 deletion exporters/prometheus/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down