Skip to content
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
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ jobs:
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: Initialize CodeQL
uses: github/codeql-action/init@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
with:
languages: cpp
- name: Autobuild
uses: github/codeql-action/autobuild@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
uses: github/codeql-action/autobuild@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
2 changes: 1 addition & 1 deletion .github/workflows/ossf-scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

add_subdirectory(common)
include_directories(common)

if(WITH_OTLP_GRPC
OR WITH_OTLP_HTTP
OR WITH_OTLP_FILE)
Expand Down
8 changes: 3 additions & 5 deletions examples/batch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include)

add_executable(batch_span_processor_example main.cc)

target_link_libraries(batch_span_processor_example ${CMAKE_THREAD_LIBS_INIT}
opentelemetry_exporter_ostream_span opentelemetry_trace)
target_link_libraries(
batch_span_processor_example PRIVATE opentelemetry-cpp::ostream_span_exporter
opentelemetry-cpp::trace)
1 change: 1 addition & 0 deletions examples/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

set(EXAMPLES_COMMON_DIR ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(foo_library)
add_subdirectory(logs_foo_library)
add_subdirectory(metrics_foo_library)
15 changes: 9 additions & 6 deletions examples/common/foo_library/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

if(DEFINED OPENTELEMETRY_BUILD_DLL)
add_definitions(-DOPENTELEMETRY_BUILD_IMPORT_DLL)
endif()

add_library(common_foo_library foo_library.h foo_library.cc)

set_target_version(common_foo_library)

target_link_libraries(common_foo_library PUBLIC ${CMAKE_THREAD_LIBS_INIT}
opentelemetry_api)
if(DEFINED OPENTELEMETRY_BUILD_DLL)
target_compile_definitions(common_foo_library
PRIVATE OPENTELEMETRY_BUILD_IMPORT_DLL)
endif()

target_include_directories(common_foo_library
PUBLIC "$<BUILD_INTERFACE:${EXAMPLES_COMMON_DIR}>")
target_link_libraries(common_foo_library PRIVATE opentelemetry-cpp::api)
14 changes: 9 additions & 5 deletions examples/common/logs_foo_library/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

add_library(common_logs_foo_library foo_library.h foo_library.cc)

set_target_version(common_logs_foo_library)

if(DEFINED OPENTELEMETRY_BUILD_DLL)
add_definitions(-DOPENTELEMETRY_BUILD_IMPORT_DLL)
target_compile_definitions(common_logs_foo_library
PRIVATE OPENTELEMETRY_BUILD_IMPORT_DLL)
endif()

add_library(common_logs_foo_library foo_library.h foo_library.cc)
set_target_version(common_logs_foo_library)
target_include_directories(common_logs_foo_library
PUBLIC $<BUILD_INTERFACE:${EXAMPLES_COMMON_DIR}>)

target_link_libraries(common_logs_foo_library PUBLIC ${CMAKE_THREAD_LIBS_INIT}
opentelemetry_api)
target_link_libraries(common_logs_foo_library PRIVATE opentelemetry-cpp::api)
14 changes: 9 additions & 5 deletions examples/common/metrics_foo_library/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

add_library(common_metrics_foo_library foo_library.h foo_library.cc)

set_target_version(common_metrics_foo_library)

if(DEFINED OPENTELEMETRY_BUILD_DLL)
add_definitions(-DOPENTELEMETRY_BUILD_IMPORT_DLL)
target_compile_definitions(common_metrics_foo_library
PRIVATE OPENTELEMETRY_BUILD_IMPORT_DLL)
endif()

add_library(common_metrics_foo_library foo_library.h foo_library.cc)
set_target_version(common_metrics_foo_library)
target_include_directories(common_metrics_foo_library
PUBLIC $<BUILD_INTERFACE:${EXAMPLES_COMMON_DIR}>)

target_link_libraries(common_metrics_foo_library
PUBLIC ${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
target_link_libraries(common_metrics_foo_library PRIVATE opentelemetry-cpp::api)
5 changes: 3 additions & 2 deletions examples/etw_threads/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ project(etw_threadpool)

add_executable(etw_threadpool main.cc)

target_link_libraries(etw_threadpool ${CMAKE_THREAD_LIBS_INIT}
opentelemetry_api opentelemetry_exporter_etw)
target_link_libraries(
etw_threadpool PRIVATE Threads::Threads opentelemetry-cpp::api
opentelemetry-cpp::etw_exporter)
12 changes: 5 additions & 7 deletions examples/grpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ patch_protobuf_targets(example_grpc_proto)
# Disable include-what-you-use on generated code.
set_target_properties(example_grpc_proto PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "")

include_directories(
${CMAKE_SOURCE_DIR}/exporters/ostream/include ${CMAKE_SOURCE_DIR}/ext/include
${CMAKE_SOURCE_DIR}/api/include/ ${CMAKE_SOURCE_DIR/})

include_directories(${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(
example_grpc_proto PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")

if(TARGET protobuf::libprotobuf)
target_link_libraries(example_grpc_proto PUBLIC gRPC::grpc++
Expand All @@ -45,7 +42,8 @@ endif()

foreach(_target client server)
add_executable(${_target} "${_target}.cc")
target_link_libraries(${_target} example_grpc_proto opentelemetry_trace
opentelemetry_exporter_ostream_span)
target_link_libraries(
${_target} PRIVATE example_grpc_proto
opentelemetry-cpp::ostream_span_exporter)
patch_protobuf_targets(${_target})
endforeach()
14 changes: 6 additions & 8 deletions examples/http/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include
${CMAKE_SOURCE_DIR}/ext/include ${CMAKE_SOURCE_DIR/})

add_executable(http_client client.cc)
add_executable(http_server server.cc)

target_link_libraries(
http_client ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace
opentelemetry_http_client_curl opentelemetry_exporter_ostream_span
${CURL_LIBRARIES})
http_client
PRIVATE opentelemetry-cpp::trace opentelemetry-cpp::http_client_curl
opentelemetry-cpp::ostream_span_exporter ${CURL_LIBRARIES})

target_link_libraries(
http_server ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace
opentelemetry_http_client_curl opentelemetry_exporter_ostream_span)
http_server
PRIVATE opentelemetry-cpp::trace opentelemetry-cpp::http_client_curl
opentelemetry-cpp::ostream_span_exporter)
20 changes: 9 additions & 11 deletions examples/logs_simple/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

if(DEFINED OPENTELEMETRY_BUILD_DLL)
add_definitions(-DOPENTELEMETRY_BUILD_IMPORT_DLL)
endif()

include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include)

add_executable(example_logs_simple main.cc)
target_link_libraries(example_logs_simple ${CMAKE_THREAD_LIBS_INIT}
common_logs_foo_library)
target_link_libraries(example_logs_simple PRIVATE common_logs_foo_library)

if(DEFINED OPENTELEMETRY_BUILD_DLL)
target_link_libraries(example_logs_simple opentelemetry_cpp)
target_compile_definitions(example_logs_simple
PRIVATE OPENTELEMETRY_BUILD_IMPORT_DLL)
target_link_libraries(example_logs_simple
PRIVATE opentelemetry-cpp::opentelemetry_cpp)
else()
target_link_libraries(
example_logs_simple opentelemetry_trace opentelemetry_logs
opentelemetry_exporter_ostream_span opentelemetry_exporter_ostream_logs)
example_logs_simple
PRIVATE opentelemetry-cpp::trace opentelemetry-cpp::logs
opentelemetry-cpp::ostream_span_exporter
opentelemetry-cpp::ostream_log_record_exporter)
endif()
20 changes: 9 additions & 11 deletions examples/metrics_simple/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

if(DEFINED OPENTELEMETRY_BUILD_DLL)
add_definitions(-DOPENTELEMETRY_BUILD_IMPORT_DLL)
endif()

include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include)

add_executable(metrics_ostream_example metrics_ostream.cc)
target_link_libraries(metrics_ostream_example ${CMAKE_THREAD_LIBS_INIT}
common_metrics_foo_library)

target_link_libraries(metrics_ostream_example
PRIVATE common_metrics_foo_library)

if(DEFINED OPENTELEMETRY_BUILD_DLL)
target_link_libraries(metrics_ostream_example opentelemetry_cpp)
target_compile_definitions(metrics_ostream_example
PRIVATE OPENTELEMETRY_BUILD_IMPORT_DLL)
target_link_libraries(metrics_ostream_example
PRIVATE opentelemetry-cpp::opentelemetry_cpp)
else()
target_link_libraries(
metrics_ostream_example opentelemetry_metrics
opentelemetry_exporter_ostream_metrics opentelemetry_resources)
metrics_ostream_example PRIVATE opentelemetry-cpp::metrics
opentelemetry-cpp::ostream_metrics_exporter)
endif()
10 changes: 4 additions & 6 deletions examples/multi_processor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include
${CMAKE_SOURCE_DIR}/exporters/memory/include)

add_executable(example_multi_processor main.cc)
target_link_libraries(
example_multi_processor ${CMAKE_THREAD_LIBS_INIT} common_foo_library
opentelemetry_trace opentelemetry_exporter_ostream_span
opentelemetry_exporter_in_memory)
example_multi_processor
PRIVATE common_foo_library opentelemetry-cpp::trace
opentelemetry-cpp::ostream_span_exporter
opentelemetry-cpp::in_memory_span_exporter)
7 changes: 3 additions & 4 deletions examples/multithreaded/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include)

add_executable(example_multithreaded main.cc)
target_link_libraries(example_multithreaded ${CMAKE_THREAD_LIBS_INIT}
opentelemetry_trace opentelemetry_exporter_ostream_span)
target_link_libraries(
example_multithreaded PRIVATE opentelemetry-cpp::trace
opentelemetry-cpp::ostream_span_exporter)
Loading
Loading