Skip to content

Commit 9b6a50e

Browse files
authored
zipkin and elasticsearch : enable cmake install, add to build pipeline (#621)
1 parent 70dafb8 commit 9b6a50e

File tree

4 files changed

+39
-3
lines changed

4 files changed

+39
-3
lines changed

ci/do_ci.sh

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ if [[ "$1" == "cmake.test" ]]; then
3030
rm -rf *
3131
cmake -DCMAKE_BUILD_TYPE=Debug \
3232
-DWITH_PROMETHEUS=ON \
33+
-DWITH_ZIPKIN=ON \
34+
-DWITH_ELASTICSEARCH=ON \
3335
-DCMAKE_CXX_FLAGS="-Werror" \
3436
"${SRC_DIR}"
3537
make

exporters/elasticsearch/CMakeLists.txt

+13
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ if(BUILD_TESTING)
1010
es_log_exporter_test ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
1111
opentelemetry_exporter_elasticsearch_logs)
1212

13+
install(
14+
TARGETS opentelemetry_exporter_elasticsearch_logs
15+
EXPORT "${PROJECT_NAME}-target"
16+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
17+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
18+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
19+
20+
install(
21+
DIRECTORY include/opentelemetry/exporters/elasticsearch
22+
DESTINATION include/opentelemetry/exporters/
23+
FILES_MATCHING
24+
PATTERN "*.h")
25+
1326
gtest_add_tests(
1427
TARGET es_log_exporter_test
1528
TEST_PREFIX exporter.

exporters/elasticsearch/test/es_log_exporter_test.cc

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ namespace logs_api = opentelemetry::logs;
1414
namespace nostd = opentelemetry::nostd;
1515
namespace logs_exporter = opentelemetry::exporter::logs;
1616

17+
TEST(ElasticsearchLogsExporterTests, Dummy)
18+
{
19+
// to enable linking
20+
}
21+
1722
#if 0
1823
// Attempt to write a log to an invalid host/port, test that the Export() returns failure
1924
TEST(ElasticsearchLogsExporterTests, InvalidEndpoint)

exporters/zipkin/CMakeLists.txt

+19-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,28 @@ find_package(CURL)
1717
if(CURL_FOUND)
1818
add_definitions(-DWITH_CURL)
1919
endif()
20-
add_library(zipkin_trace_exporter src/zipkin_exporter.cc src/recordable.cc)
20+
add_library(opentelemetry_exporter_zipkin_trace src/zipkin_exporter.cc
21+
src/recordable.cc)
22+
23+
install(
24+
TARGETS opentelemetry_exporter_zipkin_trace
25+
EXPORT "${PROJECT_NAME}-target"
26+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
27+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
28+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
29+
30+
install(
31+
DIRECTORY include/opentelemetry/exporters/zipkin
32+
DESTINATION include/opentelemetry/exporters/
33+
FILES_MATCHING
34+
PATTERN "*.h")
35+
2136
if(BUILD_TESTING)
2237
add_executable(zipkin_recordable_test test/zipkin_recordable_test.cc)
2338

24-
target_link_libraries(zipkin_recordable_test ${GTEST_BOTH_LIBRARIES}
25-
${CMAKE_THREAD_LIBS_INIT} zipkin_trace_exporter)
39+
target_link_libraries(
40+
zipkin_recordable_test ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
41+
opentelemetry_exporter_zipkin_trace http_client_curl)
2642

2743
gtest_add_tests(
2844
TARGET zipkin_recordable_test

0 commit comments

Comments
 (0)