Skip to content

Commit

Permalink
Rename http_client_curl to opentelemetry_http_client_curl (#1301)
Browse files Browse the repository at this point in the history
Signed-off-by: owent <[email protected]>
  • Loading branch information
owent authored Mar 31, 2022
1 parent a7e814a commit 76c664a
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 22 deletions.
9 changes: 5 additions & 4 deletions examples/http/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ else()
add_executable(http_server server.cc)

target_link_libraries(
http_client ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace http_client_curl
opentelemetry_exporter_ostream_span ${CURL_LIBRARIES})
http_client ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace
opentelemetry_http_client_curl opentelemetry_exporter_ostream_span
${CURL_LIBRARIES})

target_link_libraries(
http_server ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace http_client_curl
opentelemetry_exporter_ostream_span)
http_server ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace
opentelemetry_http_client_curl opentelemetry_exporter_ostream_span)
endif()
2 changes: 1 addition & 1 deletion exporters/elasticsearch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ target_include_directories(

target_link_libraries(
opentelemetry_exporter_elasticsearch_logs
PUBLIC opentelemetry_trace opentelemetry_logs http_client_curl)
PUBLIC opentelemetry_trace opentelemetry_logs opentelemetry_http_client_curl)

install(
TARGETS opentelemetry_exporter_elasticsearch_logs
Expand Down
2 changes: 1 addition & 1 deletion exporters/jaeger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ target_include_directories(

target_link_libraries(
opentelemetry_exporter_jaeger_trace
PUBLIC opentelemetry_resources http_client_curl
PUBLIC opentelemetry_resources opentelemetry_http_client_curl
PRIVATE thrift::thrift)

if(MSVC)
Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if(WITH_OTLP_HTTP)
PROPERTIES EXPORT_NAME otlp_http_client)
target_link_libraries(
opentelemetry_exporter_otlp_http_client
PUBLIC opentelemetry_sdk opentelemetry_proto http_client_curl
PUBLIC opentelemetry_sdk opentelemetry_proto opentelemetry_http_client_curl
nlohmann_json::nlohmann_json)
if(nlohmann_json_clone)
add_dependencies(opentelemetry_exporter_otlp_http_client
Expand Down
3 changes: 2 additions & 1 deletion exporters/zipkin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ add_library(opentelemetry_exporter_zipkin_trace src/zipkin_exporter.cc

target_link_libraries(
opentelemetry_exporter_zipkin_trace
PUBLIC opentelemetry_trace http_client_curl nlohmann_json::nlohmann_json)
PUBLIC opentelemetry_trace opentelemetry_http_client_curl
nlohmann_json::nlohmann_json)

install(
TARGETS opentelemetry_exporter_zipkin_trace
Expand Down
19 changes: 10 additions & 9 deletions ext/src/http/client/curl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
find_package(CURL)
if(CURL_FOUND)
add_library(http_client_curl http_client_factory_curl.cc http_client_curl.cc)
add_library(opentelemetry_http_client_curl http_client_factory_curl.cc
http_client_curl.cc)

set_target_properties(http_client_curl PROPERTIES EXPORT_NAME
http_client_curl)
set_target_properties(opentelemetry_http_client_curl
PROPERTIES EXPORT_NAME http_client_curl)

if(TARGET CURL::libcurl)
target_link_libraries(http_client_curl PUBLIC opentelemetry_ext
CURL::libcurl)
target_link_libraries(opentelemetry_http_client_curl
PUBLIC opentelemetry_ext CURL::libcurl)
else()
target_include_directories(http_client_curl
target_include_directories(opentelemetry_http_client_curl
INTERFACE "${CURL_INCLUDE_DIRS}")
target_link_libraries(http_client_curl PUBLIC opentelemetry_ext
${CURL_LIBRARIES})
target_link_libraries(opentelemetry_http_client_curl
PUBLIC opentelemetry_ext ${CURL_LIBRARIES})
endif()

install(
TARGETS http_client_curl
TARGETS opentelemetry_http_client_curl
EXPORT "${PROJECT_NAME}-target"
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down
6 changes: 4 additions & 2 deletions ext/test/http/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ if(CURL_FOUND)
${CMAKE_THREAD_LIBS_INIT})

if(TARGET CURL::libcurl)
target_link_libraries(${FILENAME} CURL::libcurl http_client_curl)
target_link_libraries(${FILENAME} opentelemetry_http_client_curl
CURL::libcurl)
else()
include_directories(${CURL_INCLUDE_DIRS})
target_link_libraries(${FILENAME} ${CURL_LIBRARIES} http_client_curl)
target_link_libraries(${FILENAME} ${CURL_LIBRARIES}
opentelemetry_http_client_curl)
endif()
gtest_add_tests(
TARGET ${FILENAME}
Expand Down
6 changes: 3 additions & 3 deletions ext/test/w3c_tracecontext_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ else()
add_executable(w3c_tracecontext_test main.cc)
target_link_libraries(
w3c_tracecontext_test
PRIVATE ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace http_client_curl
opentelemetry_exporter_ostream_span ${CURL_LIBRARIES}
nlohmann_json::nlohmann_json)
PRIVATE ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace
opentelemetry_http_client_curl opentelemetry_exporter_ostream_span
${CURL_LIBRARIES} nlohmann_json::nlohmann_json)
if(nlohmann_json_clone)
add_dependencies(w3c_tracecontext_test nlohmann_json::nlohmann_json)
endif()
Expand Down

2 comments on commit 76c664a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp api Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 76c664a Previous: a7e814a Ratio
BM_SpinLockThrashing/1/process_time/real_time 0.2876236325218564 ms/iter 0.14141324284795048 ms/iter 2.03
BM_ProcYieldSpinLockThrashing/1/process_time/real_time 0.3817177244595119 ms/iter 0.14422246424221968 ms/iter 2.65
BM_NaiveSpinLockThrashing/1/process_time/real_time 0.4908490455013582 ms/iter 0.14145591893069762 ms/iter 3.47
BM_ThreadYieldSpinLockThrashing/1/process_time/real_time 26.584704717000324 ms/iter 6.522437800531802 ms/iter 4.08
BM_ThreadYieldSpinLockThrashing/2/process_time/real_time 58.321237564086914 ms/iter 26.015281677246094 ms/iter 2.24

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp sdk Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 76c664a Previous: a7e814a Ratio
BM_BaselineBuffer/1 8159198.760986328 ns/iter 604508.1615447998 ns/iter 13.50

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.