Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/main' into opentracing-shim
Browse files Browse the repository at this point in the history
  • Loading branch information
chusitoo committed Jan 9, 2023
2 parents 32ba915 + 201b347 commit ddd71ab
Show file tree
Hide file tree
Showing 117 changed files with 2,712 additions and 2,803 deletions.
144 changes: 109 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_cmake.sh
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake tests (without otlp-exporter)
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_thrift.sh
CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/do_ci.sh cmake.test
sudo -E ./ci/setup_thrift.sh
./ci/do_ci.sh cmake.test
cmake_gcc_maintainer_test:
name: CMake gcc 12 (maintainer mode)
Expand All @@ -31,13 +37,20 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
GOOGLETEST_VERSION: 1.12.1
run: |
sudo CC=/usr/bin/gcc-12 CXX=/usr/bin/g++-12 GOOGLETEST_VERSION=1.12.1 ./ci/setup_cmake.sh
sudo CC=/usr/bin/gcc-12 CXX=/usr/bin/g++-12 ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake gcc (maintainer mode)
env:
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
run: |
sudo CC=/usr/bin/gcc-12 CXX=/usr/bin/g++-12 ./ci/setup_thrift.sh
CC=/usr/bin/gcc-12 CXX=/usr/bin/g++-12 ./ci/do_ci.sh cmake.maintainer.test
sudo -E ./ci/setup_thrift.sh
./ci/do_ci.sh cmake.maintainer.test
cmake_clang_maintainer_test:
name: CMake clang 14 (maintainer mode)
Expand All @@ -47,13 +60,20 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/clang-14
CXX: /usr/bin/clang++-14
GOOGLETEST_VERSION: 1.12.1
run: |
sudo CC=/usr/bin/clang-14 CXX=/usr/bin/clang++-14 GOOGLETEST_VERSION=1.12.1 ./ci/setup_cmake.sh
sudo CC=/usr/bin/clang-14 CXX=/usr/bin/clang++-14 ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake clang (maintainer mode)
env:
CC: /usr/bin/clang-14
CXX: /usr/bin/clang++-14
run: |
sudo CC=/usr/bin/clang-14 CXX=/usr/bin/clang++-14 ./ci/setup_thrift.sh
CC=/usr/bin/clang-14 CXX=/usr/bin/clang++-14 ./ci/do_ci.sh cmake.maintainer.test
sudo -E ./ci/setup_thrift.sh
./ci/do_ci.sh cmake.maintainer.test
cmake_msvc_maintainer_test:
name: CMake msvc (maintainer mode)
Expand All @@ -77,13 +97,19 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_cmake.sh
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake tests (without otlp-exporter)
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_thrift.sh
CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/do_ci.sh cmake.with_async_export.test
sudo -E ./ci/setup_thrift.sh
./ci/do_ci.sh cmake.with_async_export.test
cmake_absel_stl_test:
name: CMake test (with abseil)
Expand Down Expand Up @@ -113,13 +139,16 @@ jobs:
sudo ./ci/setup_ci_environment.sh
sudo ./ci/install_gcc48.sh
- name: setup cmake
run: |
sudo CC=/usr/bin/gcc-4.8 CXX=/usr/bin/g++-4.8 ./ci/setup_cmake.sh
env:
CC: /usr/bin/gcc-4.8
CXX: /usr/bin/g++-4.8
GOOGLETEST_VERSION: "1.10.0"
run: sudo -E ./ci/setup_cmake.sh
- name: run tests
run: ./ci/do_ci.sh cmake.legacy.test
env:
CC: /usr/bin/gcc-4.8
CXX: /usr/bin/g++-4.8
run: ./ci/do_ci.sh cmake.legacy.test

cmake_gcc_48_otlp_exporter_test:
name: CMake gcc 4.8 (with otlp exporter)
Expand All @@ -132,34 +161,67 @@ jobs:
run: |
sudo ./ci/setup_ci_environment.sh
sudo ./ci/install_gcc48.sh
- name: setup cmake
run: |
sudo CC=/usr/bin/gcc-4.8 CXX=/usr/bin/g++-4.8 ./ci/setup_cmake.sh
- name: setup grpc
- name: setup cmake and grpc
env:
CC: /usr/bin/gcc-4.8
CXX: /usr/bin/g++-4.8
GOOGLETEST_VERSION: "1.10.0"
run: |
sudo CC=/usr/bin/gcc-4.8 CXX=/usr/bin/g++-4.8 ./ci/setup_grpc.sh -v 4.8
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_grpc.sh -v 4.8
- name: run tests
run: ./ci/do_ci.sh cmake.legacy.exporter.otprotocol.test
env:
CC: /usr/bin/gcc-4.8
CXX: /usr/bin/g++-4.8
run: ./ci/do_ci.sh cmake.legacy.exporter.otprotocol.test

cmake_test_cxx20:
name: CMake C++20 test
cmake_test_cxx20_gcc:
name: CMake C++20 test(GCC)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: setup
env:
CMAKE_VERSION: "3.20.6"
run: |
sudo ./ci/setup_ci_environment.sh
sudo ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
- name: run tests
run: ./ci/do_ci.sh cmake.c++20.test
- name: run tests (enable stl)
run: ./ci/do_ci.sh cmake.c++20.stl.test

cmake_test_cxx20_clang:
name: CMake C++20 test(Clang with libc++)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: setup
env:
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
- name: run tests
env:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
CXXFLAGS: "-stdlib=libc++"
run: ./ci/do_ci.sh cmake.c++20.test
- name: run tests (enable stl)
env:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
CXXFLAGS: "-stdlib=libc++"
run: ./ci/do_ci.sh cmake.c++20.stl.test

cmake_otprotocol_test:
name: CMake test (with otlp-exporter)
runs-on: ubuntu-20.04
Expand All @@ -184,11 +246,17 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_cmake.sh
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run tests
run: CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/do_ci.sh cmake.test_example_plugin
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: ./ci/do_ci.sh cmake.test_example_plugin

bazel_test:
name: Bazel
Expand Down Expand Up @@ -492,11 +560,17 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_cmake.sh
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run tests and generate report
run: CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/do_ci.sh code.coverage
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: ./ci/do_ci.sh code.coverage
- name: upload report
uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v6
- uses: actions/stale@v7
with:
stale-issue-message: "This issue was marked as stale due to lack of activity."
days-before-issue-stale: 60
Expand Down
44 changes: 22 additions & 22 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug on Windows",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/<path-to-bin-file>",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false
},
{
"name": "Debug on Linux",
"type": "gdb",
"request": "launch",
"target": "${workspaceFolder}/bazel-bin/<path to the bin file>",
"cwd": "${workspaceRoot}",
"valuesFormatting": "parseText"
}
]
"version": "0.2.0",
"configurations": [
{
"name": "Debug on Windows",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/<path-to-bin-file>",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false
},
{
"name": "Debug on Linux",
"type": "gdb",
"request": "launch",
"target": "${workspaceFolder}/bazel-bin/<path to the bin file>",
"cwd": "${workspaceRoot}",
"valuesFormatting": "parseText"
}
]
}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ Increment the:

## [Unreleased]

* [METRICS] Change BatchLogRecordProcessorFactory::Create to static method
* [BUILD] Fix OTELCPP_MAINTAINER_MODE [#1844](https://github.com/open-telemetry/opentelemetry-cpp/pull/1844)
* [BUILD] Fix compatibility when using clang and libc++, upgrade GTest and
cmake when using C++20 [#1852](https://github.com/open-telemetry/opentelemetry-cpp/pull/1852)
* [SEMANTIC CONVENTIONS] Upgrade to version 1.16.0
[#1854](https://github.com/open-telemetry/opentelemetry-cpp/pull/1854)
* [SDK] BatchSpanProcessor now logs a warning when dropping a span because the
queue is full
[1871](https://github.com/open-telemetry/opentelemetry-cpp/pull/1871)
* [BUILD] Migrate from @bazel_tools//platforms to [Bazel Platforms](https://github.com/bazelbuild/platforms)
to enable Bazel 6.0.0 compatibility [#1873](https://github.com/open-telemetry/opentelemetry-cpp/pull/1873)

## [1.8.1] 2022-12-04

Expand Down Expand Up @@ -69,6 +77,8 @@ exporters [#1828](https://github.com/open-telemetry/opentelemetry-cpp/pull/1828)
* [BUILD] Add CMake OTELCPP_PROTO_PATH [#1730](https://github.com/open-telemetry/opentelemetry-cpp/pull/1730)
* [SEMANTIC CONVENTIONS] Upgrade to version 1.15.0
[#1761](https://github.com/open-telemetry/opentelemetry-cpp/pull/1761)
* [LOGS SDK] New LogRecord and logs::Recordable implementations.
[#1766](https://github.com/open-telemetry/opentelemetry-cpp/pull/1766)

Deprecation notes:

Expand Down
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ if(OTELCPP_MAINTAINER_MODE)
add_compile_options(/wd4267)

# Enforced warnings
add_compile_options(/we4265) # 'class': class has virtual functions, but
# destructor is not virtual
add_compile_options(/we5204) # A class with virtual functions has
# non-virtual trivial destructor.

elseif()
message(FATAL_ERROR "Building with unknown compiler in maintainer mode.")
endif()
Expand Down Expand Up @@ -568,3 +573,8 @@ install(
EXPORT "${PROJECT_NAME}-target"
NAMESPACE "${PROJECT_NAME}::"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")

if(BUILD_PACKAGE)
include(cmake/package.cmake)
include(CPack)
endif()
40 changes: 38 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ You can link OpenTelemetry C++ SDK with libraries provided in

### Building as standalone CMake Project

1. Getting the opentelementry-cpp source:
1. Getting the opentelementry-cpp source with its submodules:

```console
# Change to the directory where you want to create the code repository
$ cd ~
$ mkdir source && cd source && git clone --recursive https://github.com/open-telemetry/opentelemetry-cpp
$ mkdir source && cd source && git clone --recurse-submodules https://github.com/open-telemetry/opentelemetry-cpp
Cloning into 'opentelemetry-cpp'...
...
Resolving deltas: 100% (3225/3225), done.
Expand Down Expand Up @@ -269,6 +269,42 @@ work on Windows, specifically we can't safely allocate memory in one DLL and
free it in another. For now, OpenTelemetry C++ targets need to be statically
linked into the Windows applications.

## Generatring binary packages

OpenTelemetry C++ supports generating plateform specific binary packages from CMake
configuration. The packages generated through this mayn't be production ready,
and user may have to customize it further before using it as distribution.

- Linux : deb, rpm, tgz
- MacOS : tgz
- Windows : NuGet, zip

This requires platform specific package generators already installed. The package
generation can subsequently be enabled by using BUILD_PACKAGE option during cmake
configuration

```console
$ cd opentelemetry-cpp
$ mkdir build && cd build && cmake -DBUILD_PACKAGE ..

-- Package name: opentelemetry-cpp-1.8.1-ubuntu-20.04-x86_64.deb
-- Configuring done
-- Generating done
...
$
```

Once build is complete as specified in [standalone build section](#building-as-standalone-cmake-project),
the package can be generated as below.

```console
$ cpack -C debug
CPack: Create package using DEB
...
CPack: - package: /home/<user>/opentelemetry-cpp/build/opentelemetry-cpp-1.8.1-ubuntu-20.04-x86_64.deb generated.
$
```

## Using Package Managers

If you are using [Conan](https://www.conan.io/) to manage your dependencies, add
Expand Down
Loading

0 comments on commit ddd71ab

Please sign in to comment.