Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan authored Apr 17, 2024
2 parents e0c6644 + 950c336 commit 60a8614
Show file tree
Hide file tree
Showing 95 changed files with 7,220 additions and 1,855 deletions.
9 changes: 8 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@
# bazel configurations for running tests under sanitizers.
# Based on https://github.com/bazelment/trunk/blob/master/tools/bazel.rc

# Enable automatic configs based on platform
common --enable_platform_specific_config

# Needed by gRPC to build on some platforms.
build --copt -DGRPC_BAZEL_BUILD

# Set minimum supported C++ version
build:macos --host_cxxopt=-std=c++14 --cxxopt=-std=c++14
build:linux --host_cxxopt=-std=c++14 --cxxopt=-std=c++14
build:windows --host_cxxopt=/std:c++14 --cxxopt=/std:c++14

# --config=asan : Address Sanitizer.
common:asan --copt -DADDRESS_SANITIZER
common:asan --copt -fsanitize=address,bool,float-cast-overflow,integer-divide-by-zero,null,return,returns-nonnull-attribute,shift-exponent,signed-integer-overflow,unreachable,vla-bound
Expand All @@ -25,4 +33,3 @@ common:tsan --cc_output_directory_tag=tsan
# This is needed to address false positive problem with abseil.The same setting as gRPC
# https://github.com/google/sanitizers/issues/953
common:tsan --test_env=TSAN_OPTIONS=report_atomic_races=0

70 changes: 32 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake tests (without otlp-exporter)
env:
Expand All @@ -41,7 +41,7 @@ jobs:
CXX: /usr/bin/g++-13
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake gcc (maintainer mode, sync)
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
CXX: /usr/bin/g++-13
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake gcc (maintainer mode, async)
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
CXX: /usr/bin/clang++-15
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake clang (maintainer mode, sync)
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
CXX: /usr/bin/clang++-15
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake clang (maintainer mode, async)
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
CXX: /usr/bin/clang++-15
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake clang (maintainer mode, abiv2)
Expand Down Expand Up @@ -197,7 +197,6 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
- name: run tests
run: ./ci/do_ci.ps1 cmake.maintainer.test
Expand All @@ -211,7 +210,6 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
- name: run tests
env:
Expand All @@ -230,7 +228,7 @@ jobs:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake tests (without otlp-exporter)
env:
Expand All @@ -248,7 +246,7 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake tests (enable abseil-cpp)
run: |
Expand All @@ -264,7 +262,7 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake tests (enable opentracing-shim)
run: ./ci/do_ci.sh cmake.opentracing_shim.test
Expand All @@ -277,11 +275,9 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
CMAKE_VERSION: 3.20.6
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
- name: run tests (enable stl)
env:
CXX_STANDARD: '14'
Expand All @@ -295,11 +291,9 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
CMAKE_VERSION: 3.20.6
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
- name: run tests (enable stl)
env:
CXX_STANDARD: '17'
Expand All @@ -313,11 +307,9 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
CMAKE_VERSION: 3.20.6
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
- name: run tests
env:
CXX_STANDARD: '20'
Expand All @@ -339,10 +331,9 @@ jobs:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
CXXFLAGS: "-stdlib=libc++"
CMAKE_VERSION: 3.20.6
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
- name: run tests
env:
CC: /usr/bin/clang
Expand All @@ -366,11 +357,9 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
CMAKE_VERSION: 3.20.6
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
- name: run tests
env:
CXX_STANDARD: '23'
Expand All @@ -392,10 +381,9 @@ jobs:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
CXXFLAGS: "-stdlib=libc++"
CMAKE_VERSION: 3.20.6
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
- name: run tests
env:
CC: /usr/bin/clang
Expand All @@ -420,7 +408,7 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run otlp exporter tests
run: |
Expand All @@ -440,7 +428,7 @@ jobs:
ABSEIL_CPP_VERSION: '20230125.3'
CXX_STANDARD: '14'
run: |
sudo ./ci/setup_cmake.sh
sudo ./ci/setup_googletest.sh
sudo ./ci/setup_ci_environment.sh
sudo -E ./ci/install_abseil.sh
sudo -E ./ci/install_protobuf.sh
Expand All @@ -461,7 +449,7 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run otlp exporter tests
run: |
Expand All @@ -477,7 +465,7 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run otlp exporter tests
run: |
Expand All @@ -493,7 +481,7 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake install (with abseil)
run: |
Expand All @@ -515,7 +503,7 @@ jobs:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run tests
env:
Expand Down Expand Up @@ -763,7 +751,6 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
./ci/install_windows_protobuf.ps1
- name: run cmake test
Expand All @@ -780,7 +767,6 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
./ci/install_windows_protobuf.ps1
- name: run cmake test (DLL build)
Expand All @@ -799,7 +785,6 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
./ci/install_windows_protobuf.ps1
- name: run cmake test
Expand Down Expand Up @@ -829,7 +814,6 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
- name: run tests
run: ./ci/do_ci.ps1 cmake.test_example_plugin
Expand All @@ -846,7 +830,7 @@ jobs:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run tests and generate report
env:
Expand All @@ -871,6 +855,16 @@ jobs:
- name: run markdownlint
run: markdownlint .

shellcheck:
runs-on: ubuntu-latest
steps:
- name: check out code
uses: actions/checkout@v4
- name: install shellcheck
run: sudo apt install --assume-yes shellcheck
- name: run shellcheck
run: find . -name \*.sh | xargs shellcheck --severity=error

misspell:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
CXX: /usr/bin/g++-10
GOOGLETEST_VERSION: 1.12.1
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ Increment the:

## [Unreleased]

* [EXPORTER] Add OTLP File exporters
[#2540](https://github.com/open-telemetry/opentelemetry-cpp/pull/2540)
* [EXPORTER] Gzip compression support for OTLP/HTTP and OTLP/gRPC exporter
[#2530](https://github.com/open-telemetry/opentelemetry-cpp/pull/2530)
* [EXPORTER] Support URL-encoded values for `OTEL_EXPORTER_OTLP_HEADERS`
[#2579](https://github.com/open-telemetry/opentelemetry-cpp/pull/2579)
* [CI] Use platform CMake
[#2627](https://github.com/open-telemetry/opentelemetry-cpp/pull/2627)
* [PROTO] Upgrade to opentelemetry-proto v1.2.0
[#2631](https://github.com/open-telemetry/opentelemetry-cpp/pull/2631)
* [SDK] DefaultLogHandler to print errors to std::cerr, add LogLevel::None
[#2622](https://github.com/open-telemetry/opentelemetry-cpp/pull/2622)

Important changes:

Expand All @@ -32,6 +40,30 @@ Important changes:
dependency on zlib.
* [SDK] Change OTLP HTTP content_type default to binary
[#2558](https://github.com/open-telemetry/opentelemetry-cpp/pull/2558)
* [CI] Use platform CMake
[#2627](https://github.com/open-telemetry/opentelemetry-cpp/pull/2627)
* The `CI` in github no longer install a different version of `cmake`.
* It now always use the `cmake` provided by the platform.
* As part of this change, the script `ci/setup_cmake.sh` was renamed
to `ci/setup_googletest.sh`, for clarity, now that this script
only installs googletest.
* [SDK] DefaultLogHandler to print to std::cerr, add LogLevel::None
[#2622](https://github.com/open-telemetry/opentelemetry-cpp/pull/2622)
* Change DefaultLogHandler output
* Before, the default internal logger, DefaultLogHandler,
used to print to std::cout.
* Now, DefaultLogHandler prints errors and warnings to std::cerr,
as expected, while printing info and debug messages to std::cout.
* Applications that expected to find the opentelemetry-cpp internal
error log in std::cout may need adjustments, either by looking
at std::cerr instead, or by using a custom log handler.
* Additional LogLevel::None
* LogLevel::None is a new supported log level, which does not print
any message.
* Custom log handlers may need to implement a new case, to avoid
compiler warnings.
* Numbering of log levels like OTEL_INTERNAL_LOG_LEVEL_ERROR
has changed, which requires to rebuild, as the SDK ABI differs.

## [1.14.2] 2024-02-27

Expand Down
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ option(WITH_OTLP_GRPC "Whether to include the OTLP gRPC exporter in the SDK"
option(WITH_OTLP_HTTP "Whether to include the OTLP http exporter in the SDK"
OFF)

option(WITH_OTLP_FILE "Whether to include the OTLP file exporter in the SDK"
OFF)

option(
WITH_OTLP_HTTP_COMPRESSION
"Whether to include gzip compression for the OTLP http exporter in the SDK"
Expand Down Expand Up @@ -370,7 +373,9 @@ if(WITH_ABSEIL)
find_package(absl CONFIG REQUIRED)
endif()

if(WITH_OTLP_GRPC OR WITH_OTLP_HTTP)
if(WITH_OTLP_GRPC
OR WITH_OTLP_HTTP
OR WITH_OTLP_FILE)
find_package(Protobuf)
if(Protobuf_VERSION AND Protobuf_VERSION VERSION_GREATER_EQUAL "3.22.0")
if(NOT WITH_ABSEIL)
Expand Down Expand Up @@ -473,6 +478,7 @@ endif()
if(WITH_ELASTICSEARCH
OR WITH_ZIPKIN
OR WITH_OTLP_HTTP
OR WITH_OTLP_FILE
OR BUILD_W3CTRACECONTEXT_TEST
OR WITH_ETW)
set(USE_NLOHMANN_JSON ON)
Expand Down
Loading

0 comments on commit 60a8614

Please sign in to comment.