Skip to content

Commit

Permalink
Merge branch 'main' into support-client-certs
Browse files Browse the repository at this point in the history
  • Loading branch information
kylepl authored Jun 21, 2023
2 parents b3b4f12 + cfcda57 commit f55a83a
Show file tree
Hide file tree
Showing 295 changed files with 3,168 additions and 860 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,43 @@ jobs:
sudo -E ./ci/setup_thrift.sh
./ci/do_ci.sh cmake.test
#
# This build uses the latest libraries compatible
# with C++11
#
cmake_gcc_maintainer_cpp11_async_test:
name: CMake gcc 12 (maintainer mode, C++11, async)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
GOOGLETEST_VERSION: 1.12.1
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake gcc (maintainer mode, C++11, async)
env:
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
run: |
./ci/do_ci.sh cmake.maintainer.cpp11.async.test
- name: generate test cert
env:
CFSSL_VERSION: 1.6.3
run: |
sudo -E ./tools/setup-cfssl.sh
(cd ./functional/cert; ./generate_cert.sh)
- name: run func test
run: |
(cd ./functional/otlp; ./run_test.sh)
cmake_gcc_maintainer_sync_test:
name: CMake gcc 12 (maintainer mode, sync)
runs-on: ubuntu-latest
Expand Down
69 changes: 68 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,81 @@ Increment the:

## [Unreleased]

* [API] Remove include_trace_context
[#2194](https://github.com/open-telemetry/opentelemetry-cpp/pull/2194)

## [1.9.1] 2023-05-26

* [DEPRECATION] Drop C++11 support
[#2146](https://github.com/open-telemetry/opentelemetry-cpp/pull/2146)

* [CI] Upgrade Bazel and Bazelisk version
[#2118](https://github.com/open-telemetry/opentelemetry-cpp/pull/2118)
* [CI] Upgrade Google Benchmark version from 1.6.0 to 1.7.1
[#2116](https://github.com/open-telemetry/opentelemetry-cpp/pull/2116)
* [CI] Upgrade Nlohmann JSON library version from 3.10.5 to 3.11.2
[#2115](https://github.com/open-telemetry/opentelemetry-cpp/pull/2115)

* [BUILD] Missed include
[#2143](https://github.com/open-telemetry/opentelemetry-cpp/pull/2143)
* [BUILD] Add opentelemetry_proto_grpc and allow build shared
opentelemetry_proto and opentelemetry_proto_grpc on non-Windows platform.
[#2097](https://github.com/open-telemetry/opentelemetry-cpp/pull/2097)
* [BUILD] Warning cleanup, single character wrapped by std::string
[#2137](https://github.com/open-telemetry/opentelemetry-cpp/pull/2137)
* [BUILD] Add missing target dependencies
[#2128](https://github.com/open-telemetry/opentelemetry-cpp/pull/2128)
* [BUILD] Fix if JSON library already added another CMake target
[#2126](https://github.com/open-telemetry/opentelemetry-cpp/pull/2126)
* [BUILD] shared libraries with version suffix, along with the symbolic link
[#2109](https://github.com/open-telemetry/opentelemetry-cpp/pull/2109)
* [BUILD] Show warning message if WITH_OTLP is enabled
[#2112](https://github.com/open-telemetry/opentelemetry-cpp/pull/2112)
* [BUILD] Add missing STL header.
[#2107](https://github.com/open-telemetry/opentelemetry-cpp/pull/2107)
* [BUILD] Build break with old curl, macro CURL_VERSION_BITS unknown
[#2102](https://github.com/open-telemetry/opentelemetry-cpp/pull/2102)
* [BUILD] Transitive dependency issue with the otlp http exporter
[#2154](https://github.com/open-telemetry/opentelemetry-cpp/pull/2154)

* [TEST] Add unit test for log body implicit conversions.
[#2136](https://github.com/open-telemetry/opentelemetry-cpp/pull/2136)
* [TEST] Add event id to logger benchmark method
[#2133](https://github.com/open-telemetry/opentelemetry-cpp/pull/2133)

* [API] Fix inclusion header files and use forward declaration
[#2124](https://github.com/open-telemetry/opentelemetry-cpp/pull/2124)
* [API] Add user facing Logging API and Benchmarks
[#2094](https://github.com/open-telemetry/opentelemetry-cpp/pull/2094)

* [SDK] SDK support for the new OTel log
[#2123](https://github.com/open-telemetry/opentelemetry-cpp/pull/2123)

* [EXPORTER] Fixed HTTP session cleanup on shutdown
[#2111](https://github.com/open-telemetry/opentelemetry-cpp/pull/2111)
* [EXPORTER] Delegate all API calls of gRPC into
opentelemetry_exporter_otlp_grpc_client,
and make it contains all symbols needed.
[#2005](https://github.com/open-telemetry/opentelemetry-cpp/pull/2005)

* [DOC] Add Marc as maintainer.
[#2027](https://github.com/open-telemetry/opentelemetry-cpp/pull/2027)

Breaking changes:

* Add opentelemetry_proto_grpc and move gRPC sources into it.
[#2097](https://github.com/open-telemetry/opentelemetry-cpp/pull/2097)
* There will be no breaking changes for users who only use OTLP exporters and
do not directly use opentelemetry-cpp::proto. However, it is important to
note that `opentelemetry-cpp::proto` no longer contains generated gRPC codes
, and all components that depend on these gRPC codes should also link to
`opentelemetry-cpp::proto_grpc`.

Deprecations:

* The Jaeger Exporter is deprecated, see [DEPRECATED](./DEPRECATED.md) for details.
* C++11 support is to end, C++14 will be supported instead,
see [DEPRECATED](./DEPRECATED.md) for details.

## [1.9.0] 2023-04-12

Expand Down Expand Up @@ -467,7 +534,7 @@ update the semantic convention in instrumentation library is needed.
* [BUILD] Don't require applications using jaeger exporter to know about libcurl
[#1518](https://github.com/open-telemetry/opentelemetry-cpp/pull/1518)
* [EXPORTER] Inline print_value() in ostream exporter [#1512](https://github.com/open-telemetry/opentelemetry-cpp/pull/1512)
* [SDK] fix: urlPaser will incorrect parsing url like "http://abc.com/xxx@xxx/a/b"
* [SDK] fix: urlPaser will incorrect parsing url like `http://abc.com/xxx@xxx/a/b`
[#1511](https://github.com/open-telemetry/opentelemetry-cpp/pull/1511)
* [SDK] Rename `InstrumentationLibrary` to `InstrumentationScope` [#1507](https://github.com/open-telemetry/opentelemetry-cpp/pull/1507)
* [BUILD] Try to build nlohmann-json only it's depended. [#1505](https://github.com/open-telemetry/opentelemetry-cpp/pull/1505)
Expand Down
34 changes: 17 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,16 @@ if(WITH_STL)
endif()
endif()

option(WITH_OTLP "Whether to include the OpenTelemetry Protocol in the SDK" OFF)

if(WITH_OTLP)
if(DEFINED WITH_OTLP)
message(
WARNING
"WITH_OTLP is deprecated and will be removed in future. Please set either WITH_OTLP_GRPC or WITH_OTLP_HTTP, or even both."
FATAL_ERROR
"WITH_OTLP is deprecated. Please set either WITH_OTLP_GRPC=ON, WITH_OTLP_HTTP=ON, or both to ON."
)
endif()

option(WITH_OTLP_GRPC "Whether to include the OTLP gRPC exporter in the SDK"
OFF)

option(WITH_OTLP_HTTP "Whether to include the OTLP http exporter in the SDK"
OFF)

Expand Down Expand Up @@ -278,7 +279,12 @@ function(install_windows_deps)
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tools/setup-buildtools.cmd)
set(CMAKE_TOOLCHAIN_FILE
${CMAKE_CURRENT_SOURCE_DIR}/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
PARENT_SCOPE)
CACHE FILEPATH "")
message(
"Make sure that vcpkg.cmake is set as the CMAKE_TOOLCHAIN_FILE at the START of the cmake build process!
Can be command-line arg (cmake -DCMAKE_TOOLCHAIN_FILE=...) or set in your editor of choice."
)

endfunction()

function(set_target_version target_name)
Expand Down Expand Up @@ -350,11 +356,10 @@ if(WITH_PROMETHEUS)
endif()
endif()

if(WITH_OTLP)
if(WITH_OTLP_GRPC OR WITH_OTLP_HTTP)
set(protobuf_MODULE_COMPATIBLE ON)
find_package(Protobuf)
if(WITH_OTLP_GRPC OR (NOT DEFINED WITH_OTLP_GRPC AND NOT DEFINED
CACHE{WITH_OTLP_GRPC}))
if(WITH_OTLP_GRPC)
find_package(gRPC)
endif()
if((NOT Protobuf_FOUND AND NOT PROTOBUF_FOUND) OR (NOT gRPC_FOUND))
Expand All @@ -372,9 +377,7 @@ if(WITH_OTLP)
if(NOT Protobuf_FOUND AND NOT PROTOBUF_FOUND)
find_package(Protobuf REQUIRED)
endif()
if(NOT gRPC_FOUND
AND (WITH_OTLP_GRPC OR (NOT DEFINED WITH_OTLP_GRPC
AND NOT DEFINED CACHE{WITH_OTLP_GRPC})))
if(NOT gRPC_FOUND AND WITH_OTLP_GRPC)
find_package(gRPC)
endif()
if(WIN32)
Expand All @@ -392,10 +395,6 @@ if(WITH_OTLP)
endif()
include(CMakeDependentOption)

cmake_dependent_option(
WITH_OTLP_GRPC "Whether to include the OTLP gRPC exporter in the SDK" ON
"gRPC_FOUND" OFF)

message(STATUS "PROTOBUF_PROTOC_EXECUTABLE=${PROTOBUF_PROTOC_EXECUTABLE}")
include(cmake/opentelemetry-proto.cmake)
endif()
Expand Down Expand Up @@ -548,9 +547,10 @@ if(BUILD_TESTING)
${CMAKE_BINARY_DIR}/lib/libgmock.a)
elseif(WIN32)
# Make sure we are always bootsrapped with vcpkg on Windows
find_package(GTest REQUIRED)
find_package(GTest)
if(NOT (GTEST_FOUND OR GTest_FOUND))
install_windows_deps()
include(${CMAKE_TOOLCHAIN_FILE})
find_package(GTest REQUIRED)
endif()
else()
Expand Down
10 changes: 5 additions & 5 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"ctestCommandArgs": "",
"variables": [
{
"name": "WITH_OTLP",
"name": "WITH_OTLP_GRPC",
"value": "True",
"type": "BOOL"
},
Expand All @@ -40,7 +40,7 @@
"cmakeToolchain": "",
"variables": [
{
"name": "WITH_OTLP",
"name": "WITH_OTLP_GRPC",
"value": "True",
"type": "BOOL"
},
Expand Down Expand Up @@ -70,7 +70,7 @@
"type": "BOOL"
},
{
"name": "WITH_OTLP",
"name": "WITH_OTLP_GRPC",
"value": "True",
"type": "BOOL"
},
Expand Down Expand Up @@ -106,7 +106,7 @@
"type": "BOOL"
},
{
"name": "WITH_OTLP",
"name": "WITH_OTLP_GRPC",
"value": "True",
"type": "BOOL"
},
Expand All @@ -123,4 +123,4 @@
]
}
]
}
}
61 changes: 60 additions & 1 deletion DEPRECATED.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,66 @@ N/A

## [Compilers]

N/A
### Drop C++11 support

#### Announcement (C++11)

* Date: 2022-12-01
* Issue: [DEPRECATION] Drop C++11 support
[#1830](https://github.com/open-telemetry/opentelemetry-cpp/pull/1830)
* This announcement has been pinned,
visible in the issues pages since December 2022.

#### Motivation (C++11)

This repository, opentelemetry-cpp, supports a "bring your own dependency" model.

In this model,
the build scripts can be configured to:

* pick a given version for a third party library,
* build opentelemetry-cpp with the library given.

The makefiles do not mandate to use a particular version,
hence the "bring your own" denomination.

To have an up to date build, projects are encouraged to use up to date
versions of third party libraries, to benefit from bug fixes.

Now, many libraries deliver new versions that require C++14, bug fixes
releases for C++11 are no longer available.

In particular, the following components:

* GRPC C++
* abseil
* googletest

now require C++14, per
[google support policies](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md)

As a result, to stay up to date, opentelemetry-cpp needs to upgrade its
minimum build requirements to use C++14 instead of C++11.

#### Scope (C++11)

Continuous Integration (CI) builds will use C++14 instead of C++11.

The CI build for gcc 4.8 is now deprecated, to be decommissioned when C++11
support is dropped.

#### Mitigation (C++11)

Building the code with recent third party libraries will require C++14
instead of C++11.

#### Planned end of life (C++11)

Support for C++11 in opentelemetry-cpp will end on September 2023.

After this date, opentelemetry-cpp may still build properly in C++11 mode,
assuming a suitable, old, version for each dependency is used,
but the C++11 build will no longer be tested for each new release.

## [Third party dependencies]

Expand Down
3 changes: 2 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ You can link OpenTelemetry C++ SDK with libraries provided in
- `-DBUILD_SHARED_LIBS=ON` : To build shared libraries for the targets.
Please refer to note [below](#building-shared-libs-for-windows) for
Windows DLL support.
- `-DWITH_OTLP=ON` : To enable building OTLP exporter.
- `-DWITH_OTLP_GRPC=ON` : To enable building OTLP GRPC exporter.
- `-DWITH_OTLP_HTTP=ON` : To enable building OTLP HTTP exporter.
- `-DWITH_PROMETHEUS=ON` : To enable building prometheus exporter.

3. Once the build configuration is created, build the CMake targets - this
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ For edit access, get in touch on
([@open-telemetry/cpp-approvers](https://github.com/orgs/open-telemetry/teams/cpp-approvers)):

* [Josh Suereth](https://github.com/jsuereth), Google
* [Reiley Yang](https://github.com/reyang), Microsoft
* [WenTao Ou](https://github.com/owent), Tencent

[Emeritus
Expand All @@ -116,6 +115,7 @@ Maintainer/Approver/Triager](https://github.com/open-telemetry/community/blob/ma
* [Jodee Varney](https://github.com/jodeev)
* [Johannes Tax](https://github.com/pyohannes)
* [Max Golovanov](https://github.com/maxgolov)
* [Reiley Yang](https://github.com/reyang)
* [Ryan Burn](https://github.com/rnburn)

### Thanks to all the people who have contributed
Expand Down
10 changes: 4 additions & 6 deletions api/include/opentelemetry/baggage/baggage.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ class OPENTELEMETRY_EXPORT Baggage
static constexpr char kMembersSeparator = ',';
static constexpr char kMetadataSeparator = ';';

Baggage() noexcept : kv_properties_(new opentelemetry::common::KeyValueProperties()) {}
Baggage(size_t size) noexcept
: kv_properties_(new opentelemetry::common::KeyValueProperties(size))
{}
Baggage() noexcept : kv_properties_(new common::KeyValueProperties()) {}
Baggage(size_t size) noexcept : kv_properties_(new common::KeyValueProperties(size)) {}

template <class T>
Baggage(const T &keys_and_values) noexcept
: kv_properties_(new opentelemetry::common::KeyValueProperties(keys_and_values))
: kv_properties_(new common::KeyValueProperties(keys_and_values))
{}

OPENTELEMETRY_API_SINGLETON static nostd::shared_ptr<Baggage> GetDefault()
Expand Down Expand Up @@ -293,7 +291,7 @@ class OPENTELEMETRY_EXPORT Baggage

private:
// Store entries in a C-style array to avoid using std::array or std::vector.
nostd::unique_ptr<opentelemetry::common::KeyValueProperties> kv_properties_;
nostd::unique_ptr<common::KeyValueProperties> kv_properties_;
};

} // namespace baggage
Expand Down
Loading

0 comments on commit f55a83a

Please sign in to comment.