Skip to content

Commit

Permalink
Merge branch 'main' into Ngx_instrumentation_variables
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanishan1001 committed Apr 2, 2024
2 parents b51b055 + f99bdc1 commit 57faa6e
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 3 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/user_events.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: user_events

on:
push:
branches:
- '*'
path:
- 'exporters/user_events/**'
- '.github/workflows/user_events.yml'
pull_request:
branches: [main]
paths:
- 'exporters/user_events/**'
- '.github/workflows/user_events.yml'

jobs:
cmake_linux:
name: CMake Linux
runs-on: ubuntu-latest
steps:
- name: checkout opentelemetry-cpp-contrib
uses: actions/checkout@v3
with:
path: opentelemetry-cpp-contrib
submodules: "recursive"
- name: checkout opentelemetry-cpp
uses: actions/checkout@v3
with:
repository: "open-telemetry/opentelemetry-cpp"
ref: "v1.14.2"
path: "opentelemetry-cpp"
submodules: "recursive"
- name: setup dependencies
run: |
sudo apt update -y
sudo apt install -y --no-install-recommends --no-install-suggests \
build-essential \
cmake \
ninja-build \
libssl-dev \
libcurl4-openssl-dev \
libprotobuf-dev \
protobuf-compiler \
libgmock-dev \
libgtest-dev \
libbenchmark-dev
- name: run tests
run: |
sudo $GITHUB_WORKSPACE/opentelemetry-cpp/ci/setup_cmake.sh
mkdir -p "$GITHUB_WORKSPACE/opentelemetry-cpp/build"
cd "$GITHUB_WORKSPACE/opentelemetry-cpp/build"
cmake .. -G Ninja -D OPENTELEMETRY_EXTERNAL_COMPONENT_PATH=$GITHUB_WORKSPACE/opentelemetry-cpp-contrib/exporters/user_events -D WITH_OTLP_HTTP=ON
cmake --build . -j$(nproc)
ctest -j1 --output-on-failure
6 changes: 4 additions & 2 deletions exporters/user_events/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
cmake_minimum_required(VERSION 3.12)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (MAIN_PROJECT)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()

if(WIN32)
message(FATAL_ERROR "user_events exporter is Linux only for now")
Expand Down
2 changes: 1 addition & 1 deletion exporters/user_events/Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RUN cd /work && \
git clone --recursive --depth=1 https://github.com/open-telemetry/opentelemetry-cpp.git && \
cd opentelemetry-cpp && \
mkdir build && cd build && \
cmake -G Ninja -D CMAKE_BUILD_TYPE=Debug -D BUILD_TESTING=0 -D WITH_OTLP_HTTP=1 -D WITH_OTLP_GRPC=0 -D WITH_LOGS_PREVIEW=1 .. && \
cmake -G Ninja -D CMAKE_BUILD_TYPE=Debug -D BUILD_TESTING=0 -D WITH_OTLP_HTTP=1 -D WITH_OTLP_GRPC=0 -D WITH_STL=CXX17 .. && \
ninja && \
ninja install

Expand Down
2 changes: 2 additions & 0 deletions exporters/user_events/test/logs_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ TEST(UserEventsLogRecordExporter, Shutdown)
std::cout.rdbuf(output.rdbuf());

EXPECT_TRUE(exporter->Shutdown());

std::cout.rdbuf(original);
}

0 comments on commit 57faa6e

Please sign in to comment.