Skip to content

WIP: OpenTelemetry integration refactoring #689

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/columnar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install build environment
run: |
sudo apt-get update -y
sudo apt-get install -y libssl-dev cmake gcc g++ curl gdb
sudo apt-get install -y libssl-dev cmake gcc g++ curl gdb libcurl4-openssl-dev libprotobuf-dev libgrpc-dev gdb
- uses: actions/checkout@v4
with:
submodules: recursive
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libssl-dev cmake curl wget gnupg2
sudo apt-get install -y libssl-dev cmake curl wget gnupg2 libcurl4-openssl-dev libprotobuf-dev libgrpc-dev gdb
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo bash -c "echo 'deb https://apt.llvm.org/noble/ llvm-toolchain-noble main' >> /etc/apt/sources.list"
sudo apt-get update -y
Expand All @@ -65,7 +65,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libssl-dev cmake curl wget gnupg2 clang clang-tools cppcheck
sudo apt-get install -y libssl-dev cmake curl wget gnupg2 clang clang-tools cppcheck libcurl4-openssl-dev libprotobuf-dev libgrpc-dev gdb
- name: Run cppcheck
run: ./bin/check-cppcheck

Expand All @@ -78,6 +78,6 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libssl-dev cmake curl wget gnupg2 clang clang-tools clang-tidy
sudo apt-get install -y libssl-dev cmake curl wget gnupg2 clang clang-tools clang-tidy libcurl4-openssl-dev libprotobuf-dev libgrpc-dev gdb
- name: Run cppcheck
run: ./bin/check-clang-tidy
2 changes: 1 addition & 1 deletion .github/workflows/sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libssl-dev cmake curl wget gnupg2 gdb clang clang-tools valgrind
sudo apt-get install -y libssl-dev cmake curl wget gnupg2 libcurl4-openssl-dev libprotobuf-dev libgrpc-dev gdb clang clang-tools valgrind
- uses: actions/checkout@v4
with:
submodules: recursive
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Install build environment
run: |
sudo apt-get update -y
sudo apt-get install -y libssl-dev cmake gcc g++ curl gdb
sudo apt-get install -y libssl-dev cmake gcc g++ curl libcurl4-openssl-dev libprotobuf-dev libgrpc-dev gdb
- uses: actions/checkout@v4
with:
submodules: recursive
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ if(WIN32 OR NOT COUCHBASE_CXX_CLIENT_BUILD_SHARED)
set(COUCHBASE_CXX_CLIENT_VARIANT couchbase_cxx_client_static)
endif()

add_subdirectory(observability)

foreach(TARGET ${couchbase_cxx_client_LIBRARIES})
include(cmake/DetectStandardFilesystem.cmake)
couchbase_cxx_check_filesystem(
Expand Down Expand Up @@ -536,6 +538,10 @@ foreach(TARGET ${couchbase_cxx_client_LIBRARIES})
couchbase_backtrace
hdr_histogram_static)

target_link_libraries(
${TARGET}
PUBLIC couchbase_observability)

if(WIN32)
target_link_libraries(${TARGET} PRIVATE iphlpapi)
endif()
Expand Down
26 changes: 26 additions & 0 deletions cmake/ThirdPartyDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,32 @@ if(NOT TARGET spdlog::spdlog)
"SPDLOG_FMT_EXTERNAL OFF")
endif()

if(NOT TARGET opentelemetry_api)
# https://github.com/open-telemetry/opentelemetry-cpp/releases
cpmaddpackage(
NAME
opentelemetry_api
VERSION
1.20.0
GITHUB_REPOSITORY
"open-telemetry/opentelemetry-cpp"
EXCLUDE_FROM_ALL ON
OPTIONS
"OPENTELEMETRY_INSTALL OFF"
"WITH_ABI_VERSION_1 OFF"
"WITH_ABI_VERSION_2 ON"
"WITH_STL ON"
"WITH_ABSEIL OFF"
"WITH_OTLP_HTTP ON"
"WITH_OTLP_GRPC OFF"
"WITH_BENCHMARK OFF"
"BUILD_TESTING OFF"
"BUILD_SHARED_LIBS OFF"
"CMAKE_C_VISIBILITY_PRESET hidden"
"CMAKE_CXX_VISIBILITY_PRESET hidden"
"CMAKE_POSITION_INDEPENDENT_CODE ON")
endif()

if(NOT TARGET Microsoft.GSL::GSL)
# https://github.com/microsoft/GSL/releases
cpmaddpackage(
Expand Down
Loading
Loading