Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
02e6ad2
[BUILD] Do not link `prometheus-cpp::util` when it doesn't exist (#2606)
owent Mar 25, 2024
611caa7
Remove unused variable (#2609)
keith Mar 26, 2024
8dacf7e
[METRICS SDK] Remove extra OfferMeasurement call in SyncMetricsStorag…
ThomsonTan Mar 27, 2024
a06fd25
[MISC] Use set -e on all shell scripts and pass shellcheck --severity…
johnbley Mar 28, 2024
3adcc79
[CI] Add shellcheck --severity=error as a CI step (#2618)
johnbley Mar 28, 2024
fabd8cc
[CI] Upgrade to abseil 20240116.1 (CMake only) (#2599)
marcalff Mar 28, 2024
13a4c45
[CI] Benchmark, provide units with --benchmark_min_time (#2621)
marcalff Apr 3, 2024
e86ceba
[EXPORTER] OTLP file exporter (#2540)
owent Apr 3, 2024
848db57
[CI] Use platform CMake (#2627)
marcalff Apr 4, 2024
cd22f0f
[PROTO] Upgrade to opentelemetry-proto 1.2.0 (#2631)
marcalff Apr 9, 2024
78947b2
[SDK] DefaultLogHandler to print errors to std::cerr, add LogLevel::N…
marcalff Apr 13, 2024
8f15440
[SEMANTIC CONVENTIONS] Upgrade to semantic convention 1.25.0 (#2633)
esigo Apr 16, 2024
950c336
[DOC] Add readme and examples for OTLP FILE exporters. (#2638)
owent Apr 17, 2024
7aea1a6
[SEMANTIC CONVENTIONS] Rework on semantic conventions 1.25.0 (#2640)
marcalff Apr 17, 2024
6c2a6ab
[DOC] Update INSTALL.md (#2592)
chenhong805 Apr 18, 2024
054b0dc
[RELEASE] Release opentelemetry-cpp version 1.15.0 (#2639)
marcalff Apr 21, 2024
0ca7d70
[BUILD] Upgrade bazel abseil from 20220623.1 to 20230802.2 (#2650)
marcalff Apr 29, 2024
830651a
Use `nostd::enable_if_t` instead of `std::enable_if_t` (#2648)
owent Apr 29, 2024
2d077f8
Update ExemplarFilter and ExemplarReservoir for spec (#2372)
ThomsonTan Apr 29, 2024
da8e377
[BUILD] Link CoreFoundation on apple systems because some dependency …
owent May 6, 2024
4f32bc6
[SDK] Avoid missing conditional variable update and simplify atomic b…
arekay May 8, 2024
6de4ccd
[BUILD] Build break in OLTP_FILE tests (#2659)
marcalff May 8, 2024
ce14bf6
[EXPORTER] General cleanup for is_shutdown_ flags in exporters. (#2663)
marcalff May 8, 2024
4edcebd
[CI] Upgrade Maintainers CI to ubuntu-24.04 (#2670)
marcalff May 16, 2024
2db27dd
[BUILD] Upgrade to opentelemetry-proto 1.3.1 (#2669)
marcalff May 16, 2024
9c767df
[API] Return NoopLogRecord from NoopLogger (#2668)
marcalff May 16, 2024
78d488c
[BUILD] Remove the hard-coded separator in tracestate (#2672)
ThomsonTan May 23, 2024
605c3e8
[SDK] Fix forceflush may wait for ever (#2584)
owent May 27, 2024
17c3bc6
[API] DO not allow unsafe `Logger::EmitLogRecord` (#2673)
owent May 28, 2024
277190d
[BUILD] Read default proto version from `third_party_release` (#2677)
owent May 28, 2024
0dd64e0
[CI] include-what-you-use (#2629)
marcalff May 29, 2024
c42dcca
[CI] Upgrade to clang-format 18 (#2684)
marcalff May 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 63 additions & 69 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

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
60 changes: 60 additions & 0 deletions .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

name: include-what-you-use

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
iwyu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: setup dependencies
run: |
sudo apt update -y
sudo apt install -y --no-install-recommends --no-install-suggests \
build-essential \
iwyu \
cmake \
ninja-build \
libssl-dev \
libcurl4-openssl-dev \
libprotobuf-dev \
protobuf-compiler \
libgmock-dev \
libgtest-dev \
libbenchmark-dev

- name: Prepare CMake
run: |
TOPDIR=`pwd`
mkdir build && cd build
CC="clang" CXX="clang++" cmake \
-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;" \
-DBUILD_TESTING=OFF \
-DBUILD_W3CTRACECONTEXT_TEST=OFF \
..

- name: iwyu_tool
run: |
cd build
make -k 2>&1 | tee -a iwyu.log

- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: Logs (include-what-you-use)
path: ./build/*.log

- name: count warnings
run: |
cd build
COUNT=`grep -c "Warning:" iwyu.log`
echo "include-what-you-use reported ${COUNT} warning(s)"

13 changes: 13 additions & 0 deletions .iwyu.imp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

# include-what-you-use mapping file

[
# Work around for C++ STL
{ "include": ["<bits/chrono.h>", "private", "<chrono>", "public"] },

# Local opentelemetry-cpp

]

104 changes: 104 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,90 @@ Increment the:

## [Unreleased]

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

* [CI] Upgrade to clang-format 18
[#2684](https://github.com/open-telemetry/opentelemetry-cpp/pull/2684)

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 @@ -32,6 +112,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
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
14 changes: 12 additions & 2 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ if(WITH_ABSEIL)
target_link_libraries(
opentelemetry_api INTERFACE absl::bad_variant_access absl::any absl::base
absl::bits absl::city)
list(APPEND TARGET_DEPS "absl_bad_variant_access" "absl_any absl_base"
"absl_bits" "absl_city")
list(
APPEND
TARGET_DEPS
"absl_bad_variant_access"
"absl_any"
"absl_base"
"absl_bits"
"absl_city")
endif()

if(WITH_STL STREQUAL "OFF")
Expand Down Expand Up @@ -125,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
2 changes: 1 addition & 1 deletion api/include/opentelemetry/common/kv_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class KeyValueProperties
}

// Move contructor and assignment operator
Entry(Entry &&other) = default;
Entry(Entry &&other) = default;
Entry &operator=(Entry &&other) = default;

// Creates an Entry for a given key-value pair.
Expand Down
4 changes: 2 additions & 2 deletions api/include/opentelemetry/common/spin_lock_mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class SpinLockMutex
{
public:
SpinLockMutex() noexcept {}
~SpinLockMutex() noexcept = default;
SpinLockMutex(const SpinLockMutex &) = delete;
~SpinLockMutex() noexcept = default;
SpinLockMutex(const SpinLockMutex &) = delete;
SpinLockMutex &operator=(const SpinLockMutex &) = delete;

static inline void fast_yield() noexcept
Expand Down
6 changes: 1 addition & 5 deletions api/include/opentelemetry/logs/event_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,14 @@ class EventLogger
* span<pair<string_view, AttributeValue>> -> attributes(return type of MakeAttributes)
*/
template <class... ArgumentType>
void EmitEvent(nostd::string_view event_name, ArgumentType &&... args)
void EmitEvent(nostd::string_view event_name, ArgumentType &&...args)
{
nostd::shared_ptr<Logger> delegate_logger = GetDelegateLogger();
if (!delegate_logger)
{
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
20 changes: 8 additions & 12 deletions api/include/opentelemetry/logs/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Logger
* span<pair<string_view, AttributeValue>> -> attributes(return type of MakeAttributes)
*/
template <class... ArgumentType>
void EmitLogRecord(nostd::unique_ptr<LogRecord> &&log_record, ArgumentType &&... args)
void EmitLogRecord(nostd::unique_ptr<LogRecord> &&log_record, ArgumentType &&...args)
{
if (!log_record)
{
Expand Down Expand Up @@ -97,13 +97,9 @@ class Logger
* span<pair<string_view, AttributeValue>> -> attributes(return type of MakeAttributes)
*/
template <class... ArgumentType>
void EmitLogRecord(ArgumentType &&... args)
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 All @@ -124,7 +120,7 @@ class Logger
* span<pair<string_view, AttributeValue>> -> attributes(return type of MakeAttributes)
*/
template <class... ArgumentType>
void Trace(ArgumentType &&... args) noexcept
void Trace(ArgumentType &&...args) noexcept
{
static_assert(
!detail::LogRecordHasType<Severity, typename std::decay<ArgumentType>::type...>::value,
Expand All @@ -148,7 +144,7 @@ class Logger
* span<pair<string_view, AttributeValue>> -> attributes(return type of MakeAttributes)
*/
template <class... ArgumentType>
void Debug(ArgumentType &&... args) noexcept
void Debug(ArgumentType &&...args) noexcept
{
static_assert(
!detail::LogRecordHasType<Severity, typename std::decay<ArgumentType>::type...>::value,
Expand All @@ -172,7 +168,7 @@ class Logger
* span<pair<string_view, AttributeValue>> -> attributes(return type of MakeAttributes)
*/
template <class... ArgumentType>
void Info(ArgumentType &&... args) noexcept
void Info(ArgumentType &&...args) noexcept
{
static_assert(
!detail::LogRecordHasType<Severity, typename std::decay<ArgumentType>::type...>::value,
Expand All @@ -196,7 +192,7 @@ class Logger
* span<pair<string_view, AttributeValue>> -> attributes(return type of MakeAttributes)
*/
template <class... ArgumentType>
void Warn(ArgumentType &&... args) noexcept
void Warn(ArgumentType &&...args) noexcept
{
static_assert(
!detail::LogRecordHasType<Severity, typename std::decay<ArgumentType>::type...>::value,
Expand All @@ -220,7 +216,7 @@ class Logger
* span<pair<string_view, AttributeValue>> -> attributes(return type of MakeAttributes)
*/
template <class... ArgumentType>
void Error(ArgumentType &&... args) noexcept
void Error(ArgumentType &&...args) noexcept
{
static_assert(
!detail::LogRecordHasType<Severity, typename std::decay<ArgumentType>::type...>::value,
Expand All @@ -244,7 +240,7 @@ class Logger
* span<pair<string_view, AttributeValue>> -> attributes(return type of MakeAttributes)
*/
template <class... ArgumentType>
void Fatal(ArgumentType &&... args) noexcept
void Fatal(ArgumentType &&...args) noexcept
{
static_assert(
!detail::LogRecordHasType<Severity, typename std::decay<ArgumentType>::type...>::value,
Expand Down
Loading