Skip to content

Commit 2564cc6

Browse files
authored
Merge pull request #308 from open-telemetry/main
[pull] main from open-telemetry:main
2 parents 6dbfdb5 + 902ee88 commit 2564cc6

File tree

522 files changed

+26443
-5018
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

522 files changed

+26443
-5018
lines changed

.bazelrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
# bazel configurations for running tests under sanitizers.
55
# Based on https://github.com/bazelment/trunk/blob/master/tools/bazel.rc
66

7-
# TODO: Remove once support is added, avoid MODULE.bazel creation for now
8-
common --enable_bzlmod=false
9-
107
# Enable automatic configs based on platform
118
common --enable_platform_specific_config
129

10+
# Make globs that don't match anything fail
11+
common --incompatible_disallow_empty_glob
12+
1313
# Needed by gRPC to build on some platforms.
1414
build --copt -DGRPC_BAZEL_BUILD
1515

.clang-tidy

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
Checks: >
5+
-*,
6+
performance-*,
7+
portability-*,
8+
abseil-*,
9+
-abseil-string-find-str-contains,
10+
bugprone-*,
11+
-bugprone-easily-swappable-parameters,
12+
-bugprone-implicit-widening-of-multiplication-result,
13+
-bugprone-inc-dec-in-conditions,
14+
-bugprone-narrowing-conversions,
15+
-bugprone-unchecked-optional-access,
16+
-bugprone-unhandled-exception-at-new,
17+
-bugprone-unused-local-non-trivial-variable,
18+
google-*,
19+
-google-build-using-namespace,
20+
-google-default-arguments,
21+
-google-explicit-constructor,
22+
-google-readability-avoid-underscore-in-googletest-name,
23+
-google-readability-braces-around-statements,
24+
-google-readability-namespace-comments,
25+
-google-readability-todo,
26+
-google-runtime-references,
27+
misc-*,
28+
-misc-const-correctness,
29+
-misc-include-cleaner,
30+
-misc-non-private-member-variables-in-classes,
31+
-misc-unused-alias-decls,
32+
-misc-use-anonymous-namespace,
33+
cppcoreguidelines-*,
34+
-cppcoreguidelines-owning-memory,
35+
-cppcoreguidelines-avoid-do-while,
36+
-cppcoreguidelines-avoid-c-arrays,
37+
-cppcoreguidelines-avoid-magic-numbers,
38+
-cppcoreguidelines-init-variables,
39+
-cppcoreguidelines-macro-usage,
40+
-cppcoreguidelines-non-private-member-variables-in-classes,
41+
-cppcoreguidelines-avoid-non-const-global-variables,
42+
-cppcoreguidelines-pro-*

.github/workflows/ci.yml

Lines changed: 88 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,38 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
arm64_test:
11-
name: CMake test arm64 (with modern protobuf,grpc and abseil)
12-
runs-on: actuated-arm64-4cpu-16gb
13-
steps:
14-
- uses: actions/checkout@v4
15-
with:
16-
submodules: 'recursive'
17-
- name: setup
18-
env:
19-
PROTOBUF_VERSION: '23.3'
20-
ABSEIL_CPP_VERSION: '20230125.3'
21-
CXX_STANDARD: '14'
22-
CC: /usr/bin/gcc-10
23-
CXX: /usr/bin/g++-10
24-
run: |
25-
sudo -E ./ci/setup_gcc10.sh
26-
sudo -E ./ci/setup_cmake.sh
27-
sudo -E ./ci/setup_ci_environment.sh
28-
sudo -E ./ci/setup_googletest.sh
29-
sudo -E ./ci/install_abseil.sh
30-
sudo -E ./ci/install_protobuf.sh
31-
- name: run otlp exporter tests
32-
env:
33-
CC: /usr/bin/gcc-10
34-
CXX: /usr/bin/g++-10
35-
WITH_ABSEIL: 'ON'
36-
CXX_STANDARD: '14'
37-
run: |
38-
sudo -E ./ci/setup_grpc.sh -m -p protobuf -p abseil-cpp
39-
./ci/do_ci.sh cmake.exporter.otprotocol.test
10+
11+
# Commented 2024-11-06, lack of workers in github causes CI failures
12+
# arm64_test:
13+
# name: CMake test arm64 (with modern protobuf,grpc and abseil)
14+
# runs-on: actuated-arm64-4cpu-16gb
15+
# steps:
16+
# - uses: actions/checkout@v4
17+
# with:
18+
# submodules: 'recursive'
19+
# - name: setup
20+
# env:
21+
# PROTOBUF_VERSION: '23.3'
22+
# ABSEIL_CPP_VERSION: '20230125.3'
23+
# CXX_STANDARD: '14'
24+
# CC: /usr/bin/gcc-10
25+
# CXX: /usr/bin/g++-10
26+
# run: |
27+
# sudo -E ./ci/setup_gcc10.sh
28+
# sudo -E ./ci/setup_cmake.sh
29+
# sudo -E ./ci/setup_ci_environment.sh
30+
# sudo -E ./ci/setup_googletest.sh
31+
# sudo -E ./ci/install_abseil.sh
32+
# sudo -E ./ci/install_protobuf.sh
33+
# - name: run otlp exporter tests
34+
# env:
35+
# CC: /usr/bin/gcc-10
36+
# CXX: /usr/bin/g++-10
37+
# WITH_ABSEIL: 'ON'
38+
# CXX_STANDARD: '14'
39+
# run: |
40+
# sudo -E ./ci/setup_grpc.sh -m -p protobuf -p abseil-cpp
41+
# ./ci/do_ci.sh cmake.exporter.otprotocol.test
4042

4143
cmake_test:
4244
name: CMake test (without otlp-exporter)
@@ -47,15 +49,15 @@ jobs:
4749
submodules: 'recursive'
4850
- name: setup
4951
env:
50-
CC: /usr/bin/gcc-10
51-
CXX: /usr/bin/g++-10
52+
CC: /usr/bin/gcc-12
53+
CXX: /usr/bin/g++-12
5254
run: |
5355
sudo -E ./ci/setup_googletest.sh
5456
sudo -E ./ci/setup_ci_environment.sh
5557
- name: run cmake tests (without otlp-exporter)
5658
env:
57-
CC: /usr/bin/gcc-10
58-
CXX: /usr/bin/g++-10
59+
CC: /usr/bin/gcc-12
60+
CXX: /usr/bin/g++-12
5961
run: |
6062
./ci/do_ci.sh cmake.test
6163
@@ -261,15 +263,15 @@ jobs:
261263
submodules: 'recursive'
262264
- name: setup
263265
env:
264-
CC: /usr/bin/gcc-10
265-
CXX: /usr/bin/g++-10
266+
CC: /usr/bin/gcc-12
267+
CXX: /usr/bin/g++-12
266268
run: |
267269
sudo -E ./ci/setup_googletest.sh
268270
sudo -E ./ci/setup_ci_environment.sh
269271
- name: run cmake tests (without otlp-exporter)
270272
env:
271-
CC: /usr/bin/gcc-10
272-
CXX: /usr/bin/g++-10
273+
CC: /usr/bin/gcc-12
274+
CXX: /usr/bin/g++-12
273275
run: |
274276
./ci/do_ci.sh cmake.with_async_export.test
275277
@@ -357,7 +359,7 @@ jobs:
357359

358360
cmake_test_cxx20_clang:
359361
name: CMake C++20 test(Clang with libc++)
360-
runs-on: ubuntu-latest
362+
runs-on: ubuntu-22.04
361363
steps:
362364
- uses: actions/checkout@v4
363365
with:
@@ -407,7 +409,7 @@ jobs:
407409

408410
cmake_test_cxx23_clang:
409411
name: CMake C++23 test(Clang with libc++)
410-
runs-on: ubuntu-latest
412+
runs-on: ubuntu-22.04
411413
steps:
412414
- uses: actions/checkout@v4
413415
with:
@@ -536,15 +538,15 @@ jobs:
536538
submodules: 'recursive'
537539
- name: setup
538540
env:
539-
CC: /usr/bin/gcc-10
540-
CXX: /usr/bin/g++-10
541+
CC: /usr/bin/gcc-12
542+
CXX: /usr/bin/g++-12
541543
run: |
542544
sudo -E ./ci/setup_googletest.sh
543545
sudo -E ./ci/setup_ci_environment.sh
544546
- name: run tests
545547
env:
546-
CC: /usr/bin/gcc-10
547-
CXX: /usr/bin/g++-10
548+
CC: /usr/bin/gcc-12
549+
CXX: /usr/bin/g++-12
548550
run: ./ci/do_ci.sh cmake.test_example_plugin
549551

550552
bazel_test:
@@ -856,7 +858,7 @@ jobs:
856858

857859
code_coverage:
858860
name: Code coverage
859-
runs-on: ubuntu-latest
861+
runs-on: ubuntu-22.04
860862
steps:
861863
- uses: actions/checkout@v4
862864
with:
@@ -874,9 +876,9 @@ jobs:
874876
CXX: /usr/bin/g++-10
875877
run: ./ci/do_ci.sh code.coverage
876878
- name: upload report
877-
uses: codecov/codecov-action@v4
879+
uses: codecov/codecov-action@v5
878880
with:
879-
file: /home/runner/build/coverage.info
881+
files: /home/runner/build/coverage.info
880882

881883
markdown-lint:
882884
runs-on: ubuntu-latest
@@ -923,3 +925,42 @@ jobs:
923925
- name: run ./ci/docfx.cmd
924926
shell: cmd
925927
run: ./ci/docfx.cmd
928+
929+
w3c_trace_context_compliance_v1:
930+
name: W3C Distributed Tracing Validation V1
931+
runs-on: ubuntu-latest
932+
steps:
933+
- name: Checkout open-telemetry/opentelemetry-cpp
934+
uses: actions/checkout@v4
935+
with:
936+
submodules: 'recursive'
937+
- name: setup
938+
env:
939+
CC: /usr/bin/gcc-12
940+
CXX: /usr/bin/g++-12
941+
run: |
942+
sudo -E ./ci/setup_googletest.sh
943+
sudo -E ./ci/setup_ci_environment.sh
944+
- name: run w3c trace-context test server (background)
945+
env:
946+
CXX_STANDARD: '14'
947+
run: |
948+
./ci/do_ci.sh cmake.w3c.trace-context.build-server
949+
cd $HOME/build/ext/test/w3c_tracecontext_http_test_server
950+
./w3c_tracecontext_http_test_server &
951+
- name: Checkout w3c/trace-context repo
952+
uses: actions/checkout@v4
953+
with:
954+
repository: w3c/trace-context
955+
path: trace-context
956+
- name: install dependencies
957+
run: |
958+
sudo apt update && sudo apt install python3-pip
959+
sudo pip3 install aiohttp
960+
- name: run w3c trace-context test suite
961+
env:
962+
SPEC_LEVEL: 1
963+
run:
964+
|
965+
python ${GITHUB_WORKSPACE}/trace-context/test/test.py http://localhost:30000/test TraceContextTest AdvancedTest
966+
curl http://localhost:30000/stop

.github/workflows/clang-tidy.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: clang-tidy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
clang-tidy:
11+
runs-on: ubuntu-24.04
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
submodules: recursive
16+
17+
- name: Setup Environment
18+
env:
19+
PROTOBUF_VERSION: '23.3'
20+
ABSEIL_CPP_VERSION: '20230125.3'
21+
CXX_STANDARD: '14'
22+
run: |
23+
sudo apt update -y
24+
sudo apt install -y --no-install-recommends --no-install-suggests \
25+
build-essential \
26+
iwyu \
27+
cmake \
28+
libssl-dev \
29+
libcurl4-openssl-dev \
30+
libprotobuf-dev \
31+
protobuf-compiler \
32+
libgmock-dev \
33+
libgtest-dev \
34+
libbenchmark-dev
35+
36+
if ! command -v clang-tidy &> /dev/null; then
37+
echo "clang-tidy could not be found"
38+
exit 1
39+
fi
40+
echo "Using clang-tidy version: $(clang-tidy --version)"
41+
echo "clang-tidy installed at: $(which clang-tidy)"
42+
43+
44+
- name: Prepare CMake
45+
env:
46+
CC: clang
47+
CXX: clang++
48+
run: |
49+
echo "Running cmake..."
50+
cmake -B build \
51+
-DCMAKE_CXX_STANDARD=14 \
52+
-DWITH_STL=CXX14 \
53+
-DWITH_OTLP_HTTP=ON \
54+
-DWITH_OTLP_FILE=ON \
55+
-DWITH_PROMETHEUS=ON \
56+
-DWITH_ZIPKIN=ON \
57+
-DWITH_ELASTICSEARCH=ON \
58+
-DWITH_OTLP_HTTP_COMPRESSION=ON \
59+
-DWITH_EXAMPLES=ON \
60+
-DWITH_EXAMPLES_HTTP=ON \
61+
-DBUILD_W3CTRACECONTEXT_TEST=ON \
62+
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
63+
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
64+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
65+
66+
- name: Run clang-tidy
67+
run: |
68+
cmake --build build --target opentelemetry_proto
69+
jq -r .[].file build/compile_commands.json | grep -vE '/(generated|third_party)/' | xargs -P $(nproc) -n 1 clang-tidy --quiet -p build 2>&1 | tee -a clang-tidy.log
70+
71+
- uses: actions/upload-artifact@v4
72+
with:
73+
name: Logs (clang-tidy)
74+
path: ./clang-tidy.log
75+
76+
- name: Count warnings
77+
run: |
78+
COUNT=$(grep -c "warning:" clang-tidy.log)
79+
echo "clang-tidy reported ${COUNT} warning(s)"
80+
81+
# TODO: include WITH_OTLP_GRPC and WITH_ABSEIL flags.

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
rm -rf third_party
2121
- name: Setup
2222
env:
23-
CC: /usr/bin/gcc-10
24-
CXX: /usr/bin/g++-10
23+
CC: /usr/bin/gcc-12
24+
CXX: /usr/bin/g++-12
2525
GOOGLETEST_VERSION: 1.12.1
2626
run: |
2727
sudo -E ./ci/setup_googletest.sh

0 commit comments

Comments
 (0)