Skip to content

Commit

Permalink
Merge branch 'main' into fix_ci_iwyu
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff authored May 16, 2024
2 parents 0bb3057 + 9c767df commit 8da8472
Show file tree
Hide file tree
Showing 99 changed files with 6,632 additions and 1,906 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ jobs:
./ci/do_ci.sh cmake.test
cmake_gcc_maintainer_sync_test:
name: CMake gcc 13 (maintainer mode, sync)
runs-on: ubuntu-latest
name: CMake gcc 14 (maintainer mode, sync)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-13
CXX: /usr/bin/g++-13
CC: /usr/bin/gcc-14
CXX: /usr/bin/g++-14
PROTOBUF_VERSION: 21.12
run: |
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)
env:
CC: /usr/bin/gcc-13
CXX: /usr/bin/g++-13
CC: /usr/bin/gcc-14
CXX: /usr/bin/g++-14
run: |
./ci/do_ci.sh cmake.maintainer.sync.test
- name: generate test cert
Expand All @@ -61,25 +61,25 @@ jobs:
(cd ./functional/otlp; ./run_test.sh)
cmake_gcc_maintainer_async_test:
name: CMake gcc 13 (maintainer mode, async)
runs-on: ubuntu-latest
name: CMake gcc 14 (maintainer mode, async)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-13
CXX: /usr/bin/g++-13
CC: /usr/bin/gcc-14
CXX: /usr/bin/g++-14
PROTOBUF_VERSION: 21.12
run: |
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)
env:
CC: /usr/bin/gcc-13
CXX: /usr/bin/g++-13
CC: /usr/bin/gcc-14
CXX: /usr/bin/g++-14
run: |
./ci/do_ci.sh cmake.maintainer.async.test
- name: generate test cert
Expand All @@ -93,25 +93,25 @@ jobs:
(cd ./functional/otlp; ./run_test.sh)
cmake_clang_maintainer_sync_test:
name: CMake clang 15 (maintainer mode, sync)
runs-on: ubuntu-latest
name: CMake clang 18 (maintainer mode, sync)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/clang-15
CXX: /usr/bin/clang++-15
CC: /usr/bin/clang-18
CXX: /usr/bin/clang++-18
PROTOBUF_VERSION: 21.12
run: |
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)
env:
CC: /usr/bin/clang-15
CXX: /usr/bin/clang++-15
CC: /usr/bin/clang-18
CXX: /usr/bin/clang++-18
run: |
./ci/do_ci.sh cmake.maintainer.sync.test
- name: generate test cert
Expand All @@ -125,25 +125,25 @@ jobs:
(cd ./functional/otlp; ./run_test.sh)
cmake_clang_maintainer_async_test:
name: CMake clang 15 (maintainer mode, async)
runs-on: ubuntu-latest
name: CMake clang 18 (maintainer mode, async)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/clang-15
CXX: /usr/bin/clang++-15
CC: /usr/bin/clang-18
CXX: /usr/bin/clang++-18
PROTOBUF_VERSION: 21.12
run: |
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)
env:
CC: /usr/bin/clang-15
CXX: /usr/bin/clang++-15
CC: /usr/bin/clang-18
CXX: /usr/bin/clang++-18
run: |
./ci/do_ci.sh cmake.maintainer.async.test
- name: generate test cert
Expand All @@ -157,25 +157,25 @@ jobs:
(cd ./functional/otlp; ./run_test.sh)
cmake_clang_maintainer_abiv2_test:
name: CMake clang 15 (maintainer mode, abiv2)
runs-on: ubuntu-latest
name: CMake clang 18 (maintainer mode, abiv2)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/clang-15
CXX: /usr/bin/clang++-15
CC: /usr/bin/clang-18
CXX: /usr/bin/clang++-18
PROTOBUF_VERSION: 21.12
run: |
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)
env:
CC: /usr/bin/clang-15
CXX: /usr/bin/clang++-15
CC: /usr/bin/clang-18
CXX: /usr/bin/clang++-18
run: |
./ci/do_ci.sh cmake.maintainer.abiv2.test
- name: generate test cert
Expand Down
94 changes: 92 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,87 @@ Increment the:

## [Unreleased]

* [EXPORTER] Add OTLP File exporters
[#2540](https://github.com/open-telemetry/opentelemetry-cpp/pull/2540)
* [SDK] Update ExemplarFilter and ExemplarReservoir for spec
[#2372](https://github.com/open-telemetry/opentelemetry-cpp/pull/2372)

Notes on experimental features:

* [#2372](https://github.com/open-telemetry/opentelemetry-cpp/issues/2372)
introduced `MeterProvider::SetExemplar()` which accepts en
`ExemplarFilterType` enumeration with `kAlwaysOff`, `kAlwaysOn` and
`kTraceBased`.

## [1.15.0] 2024-04-21

* [EXPORTER] Change OTLP HTTP content_type default to binary
[#2564](https://github.com/open-telemetry/opentelemetry-cpp/pull/2564)
* [DOC] Fix OTLP documentation: Default endpoint is wrong for OTLP/HTTP
[#2560](https://github.com/open-telemetry/opentelemetry-cpp/pull/2560)
* [BUILD] Fix old style cast warning
[#2567](https://github.com/open-telemetry/opentelemetry-cpp/pull/2567)
* [EXPORTER] Gzip compression support for OTLP/HTTP and OTLP/gRPC exporter
[#2530](https://github.com/open-telemetry/opentelemetry-cpp/pull/2530)
* [BUILD] update vcpkg submodule to 2024.02.14
[#2575](https://github.com/open-telemetry/opentelemetry-cpp/pull/2575)
* [SDK] Support for OTEL_SERVICE_NAME
[#2577](https://github.com/open-telemetry/opentelemetry-cpp/pull/2577)
* [EXPORTER] Support URL-encoded values for `OTEL_EXPORTER_OTLP_HEADERS`
[#2579](https://github.com/open-telemetry/opentelemetry-cpp/pull/2579)
* [BUILD] CMake cleanup for message()
[#2582](https://github.com/open-telemetry/opentelemetry-cpp/pull/2582)
* [BUILD] Bump CMake minimum required version to 3.9
[#2581](https://github.com/open-telemetry/opentelemetry-cpp/pull/2581)
* [BUILD] Provide LIKELY / UNLIKELY macros
[#2580](https://github.com/open-telemetry/opentelemetry-cpp/pull/2580)
* [EXPORTER] OTLP: Fix missing ResourceMetrics SchemaURL
[#2587](https://github.com/open-telemetry/opentelemetry-cpp/pull/2587)
* [ETW] cleanup include path
[#2594](https://github.com/open-telemetry/opentelemetry-cpp/pull/2594)
* Upgrade to googletest 1.14.0
[#2596](https://github.com/open-telemetry/opentelemetry-cpp/pull/2596)
* Upgrade to nlohmann_json 3.11.3
[#2595](https://github.com/open-telemetry/opentelemetry-cpp/pull/2595)
* [BAZEL] Move -std=c++14 to .bazelrc
[#2600](https://github.com/open-telemetry/opentelemetry-cpp/pull/2600)
* [BAZEL] Fix -std=c++14 warning on Windows
[#2601](https://github.com/open-telemetry/opentelemetry-cpp/pull/2601)
* Upgrade to benchmark 1.8.3
[#2597](https://github.com/open-telemetry/opentelemetry-cpp/pull/2597)
* Upgrade to prometheus 1.2.4
[#2598](https://github.com/open-telemetry/opentelemetry-cpp/pull/2598)
* [DOC] Fix typo: Asynchronouse -> Asynchronous in meter.h
[#2604](https://github.com/open-telemetry/opentelemetry-cpp/pull/2604)
* [BUILD] Do not link prometheus-cpp::util when it doesn't exist
[#2606](https://github.com/open-telemetry/opentelemetry-cpp/pull/2606)
* [SDK] Remove unused variable
[#2609](https://github.com/open-telemetry/opentelemetry-cpp/pull/2609)
* [METRICS SDK] Remove extra OfferMeasurement call
in SyncMetricsStorage::OfferMeasurement
[#2610](https://github.com/open-telemetry/opentelemetry-cpp/pull/2610)
* [MISC] Use set -e on all shell scripts and pass shellcheck --severity=error
[#2616](https://github.com/open-telemetry/opentelemetry-cpp/pull/2616)
* [CI] Add shellcheck --severity=error as a CI step
[#2618](https://github.com/open-telemetry/opentelemetry-cpp/pull/2618)
* [CI] Upgrade to abseil 20240116.1 (CMake only)
[#2599](https://github.com/open-telemetry/opentelemetry-cpp/pull/2599)
* [CI] Benchmark, provide units with --benchmark_min_time
[#2621](https://github.com/open-telemetry/opentelemetry-cpp/pull/2621)
* [EXPORTER] OTLP file exporter
[#2540](https://github.com/open-telemetry/opentelemetry-cpp/pull/2540)
* [CI] Use platform CMake
[#2627](https://github.com/open-telemetry/opentelemetry-cpp/pull/2627)
* [PROTO] Upgrade to opentelemetry-proto 1.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)
* [SEMANTIC CONVENTIONS] Upgrade to semantic convention 1.25.0
[#2633](https://github.com/open-telemetry/opentelemetry-cpp/pull/2633)
* [DOC] Add readme and examples for OTLP FILE exporters.
[#2638](https://github.com/open-telemetry/opentelemetry-cpp/pull/2638)
* [SEMANTIC CONVENTIONS] Rework on semantic conventions 1.25.0
[#2640](https://github.com/open-telemetry/opentelemetry-cpp/pull/2640)
* [DOC] Update INSTALL.md
[#2592](https://github.com/open-telemetry/opentelemetry-cpp/pull/2592)

Important changes:

Expand All @@ -43,6 +116,23 @@ Important changes:
* 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
2 changes: 2 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ You can link OpenTelemetry C++ SDK with libraries provided in
- `-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.
- `-DOPENTELEMETRY_INSTALL=ON`: To install `otel-cpp` library needed
for external code linking.

3. Once the build configuration is created, build the CMake targets - this
includes building SDKs and unittests for API and SDK. Note that since API is
Expand Down
4 changes: 4 additions & 0 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ if(WITH_OTLP_HTTP_COMPRESSION)
INTERFACE ENABLE_OTLP_COMPRESSION_PREVIEW)
endif()

if(APPLE)
target_link_libraries(opentelemetry_api INTERFACE "-framework CoreFoundation")
endif()

include(${PROJECT_SOURCE_DIR}/cmake/pkgconfig.cmake)

if(OPENTELEMETRY_INSTALL)
Expand Down
4 changes: 0 additions & 4 deletions api/include/opentelemetry/logs/event_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ class EventLogger
return;
}
nostd::unique_ptr<LogRecord> log_record = delegate_logger->CreateLogRecord();
if (!log_record)
{
return;
}

IgnoreTraitResult(
detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::template Set(
Expand Down
4 changes: 0 additions & 4 deletions api/include/opentelemetry/logs/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ class Logger
void EmitLogRecord(ArgumentType &&... args)
{
nostd::unique_ptr<LogRecord> log_record = CreateLogRecord();
if (!log_record)
{
return;
}

EmitLogRecord(std::move(log_record), std::forward<ArgumentType>(args)...);
}
Expand Down
30 changes: 29 additions & 1 deletion api/include/opentelemetry/logs/noop.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,39 @@ class NoopLogger final : public Logger
public:
const nostd::string_view GetName() noexcept override { return "noop logger"; }

nostd::unique_ptr<LogRecord> CreateLogRecord() noexcept override { return nullptr; }
nostd::unique_ptr<LogRecord> CreateLogRecord() noexcept override
{
/*
* Do not return memory shared between threads,
* a `new` + `delete` for each noop record can not be avoided,
* due to the semantic of unique_ptr.
*/
return nostd::unique_ptr<LogRecord>(new NoopLogRecord());
}

using Logger::EmitLogRecord;

void EmitLogRecord(nostd::unique_ptr<LogRecord> &&) noexcept override {}

private:
class NoopLogRecord : public LogRecord
{
public:
NoopLogRecord() = default;
~NoopLogRecord() override = default;

void SetTimestamp(common::SystemTimestamp /* timestamp */) noexcept override {}
void SetObservedTimestamp(common::SystemTimestamp /* timestamp */) noexcept override {}
void SetSeverity(logs::Severity /* severity */) noexcept override {}
void SetBody(const common::AttributeValue & /* message */) noexcept override {}
void SetAttribute(nostd::string_view /* key */,
const common::AttributeValue & /* value */) noexcept override
{}
void SetEventId(int64_t /* id */, nostd::string_view /* name */) noexcept override {}
void SetTraceId(const trace::TraceId & /* trace_id */) noexcept override {}
void SetSpanId(const trace::SpanId & /* span_id */) noexcept override {}
void SetTraceFlags(const trace::TraceFlags & /* trace_flags */) noexcept override {}
};
};

/**
Expand Down
Loading

0 comments on commit 8da8472

Please sign in to comment.