Skip to content

Commit

Permalink
Merge branch 'main' into poc_config_yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff committed Feb 17, 2024
2 parents 7c81b0b + e1119ed commit df13b50
Show file tree
Hide file tree
Showing 48 changed files with 1,630 additions and 236 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ jobs:
CXX: /usr/bin/g++-10
run: ./ci/do_ci.sh code.coverage
- name: upload report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: /home/runner/build/coverage.info

Expand Down
90 changes: 76 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,95 @@ Increment the:

## [Unreleased]

* [API] Fix b3, w3c and jaeger propagators: they will not overwrite
the active span with a default invalid span, which is especially useful
when used with CompositePropagator
[TEST] fix string "current-span" to trace:kSpan which is "active_span"
[#2511](https://github.com/open-telemetry/opentelemetry-cpp/pull/2511)
* [REMOVAL] Remove option WITH_OTLP_HTTP_SSL_PREVIEW
[#2435](https://github.com/open-telemetry/opentelemetry-cpp/pull/2435)
* [BUILD] Fix removing of NOMINMAX on Windows
[#2449](https://github.com/open-telemetry/opentelemetry-cpp/pull/2449)
* [BUILD] Introduce CXX 20 CI pipeline for MSVC/Windows
[#2450](https://github.com/open-telemetry/opentelemetry-cpp/pull/2450)
## [1.14.0] 2024-02-16

* [BUILD] Add DLL build CI pipeline with CXX20
[#2465](https://github.com/open-telemetry/opentelemetry-cpp/pull/2465)
* [EXPORTER] Set `is_monotonic` flag for Observable Counters
[#2478](https://github.com/open-telemetry/opentelemetry-cpp/pull/2478)
* [PROTO] Upgrade to opentelemetry-proto v1.1.0
[#2488](https://github.com/open-telemetry/opentelemetry-cpp/pull/2488)
* [BUILD] Introduce CXX 20 CI pipeline for MSVC/Windows
[#2450](https://github.com/open-telemetry/opentelemetry-cpp/pull/2450)
* [API] Propagation: fix for hex conversion to binary for odd hex strings
[#2533](https://github.com/open-telemetry/opentelemetry-cpp/pull/2533)
* [DOC] Fix calendar link
[#2532](https://github.com/open-telemetry/opentelemetry-cpp/pull/2532)
* [ETW EXPORTER] Remove namespace using in ETW exporter which affects global
namespace
[#2531](https://github.com/open-telemetry/opentelemetry-cpp/pull/2531)
* [BUILD] Don't invoke vcpkg from this repo with CMAKE_TOOLCHAIN_FILE set
[#2527](https://github.com/open-telemetry/opentelemetry-cpp/pull/2527)
* [EXPORTER] Async exporting for otlp grpc
[#2407](https://github.com/open-telemetry/opentelemetry-cpp/pull/2407)
* [METRICS SDK] Fix attribute filtering for synchronous instruments.
[#2472](https://github.com/open-telemetry/opentelemetry-cpp/pull/2472)
* [BUILD] Better handling of OPENTELEMETRY_STL_VERSION under Bazel.
[#2503](https://github.com/open-telemetry/opentelemetry-cpp/pull/2503)
* [DOC] Fixes CI markdown error MD055 - Table pipe style
[#2517](https://github.com/open-telemetry/opentelemetry-cpp/pull/2517)
* [API] Propagators: do not overwrite the active span with a default invalid
span [#2511](https://github.com/open-telemetry/opentelemetry-cpp/pull/2511)
* [BUILD] Updated the recorded vcpkg submodule version
[#2513](https://github.com/open-telemetry/opentelemetry-cpp/pull/2513)
* [BUILD] Remove unnecessary usage/includes of nostd/type_traits
[#2509](https://github.com/open-telemetry/opentelemetry-cpp/pull/2509)
* [SEMANTIC CONVENTIONS] Upgrade to version 1.24.0
[#2461](https://github.com/open-telemetry/opentelemetry-cpp/pull/2461)
* [EXAMPLES] Improve readme of Metrics example
[#2510](https://github.com/open-telemetry/opentelemetry-cpp/pull/2510)
* [BUILD] Clang-15 warning about `__has_trivial_destructor`
[#2502](https://github.com/open-telemetry/opentelemetry-cpp/pull/2502)
* [BUILD] Fix multiple assignment operators for SpinLockMutex
[#2501](https://github.com/open-telemetry/opentelemetry-cpp/pull/2501)
* [BUILD] Alternative way of exporting symbols (generating .def file)
[#2476](https://github.com/open-telemetry/opentelemetry-cpp/pull/2476)
* [CI] Make cmake.c++20*.test actually use C++20 and add cmake.c++23*.test
[#2496](https://github.com/open-telemetry/opentelemetry-cpp/pull/2496)
* [DOCUMENTATION] Add api reference documentation for logs
[#2497](https://github.com/open-telemetry/opentelemetry-cpp/pull/2497)
* [BUILD] Fix variable shadow
[#2498](https://github.com/open-telemetry/opentelemetry-cpp/pull/2498)
* [BUILD] Fix checks on __cplusplus under MSVC, do not assume /Zc
[#2493](https://github.com/open-telemetry/opentelemetry-cpp/pull/2493)
* [EXAMPLES] Use logs API instead of logs bridge API in the example
[#2494](https://github.com/open-telemetry/opentelemetry-cpp/pull/2494)
* [EXPORTER] Fix forward protocol encoding for ETW exporter
[#2473](https://github.com/open-telemetry/opentelemetry-cpp/pull/2473)
* [BUILD] Skip patch alias target
[#2457](https://github.com/open-telemetry/opentelemetry-cpp/pull/2457)
* [EXPORTER] Rename populate_otel_scope to without_otel_scope
[#2479](https://github.com/open-telemetry/opentelemetry-cpp/pull/2479)
* [EXPORTER SDK] Additional fixes after NOMINMAX removal on Windows
[#2475](https://github.com/open-telemetry/opentelemetry-cpp/pull/2475)
* [EXPORTER] Do not use regex in `CleanUpString` because some implementations of
STL may crash.
[#2464](https://github.com/open-telemetry/opentelemetry-cpp/pull/2464)
* [EXPORTER] Fix Aggregation type detection in OTLP Exporter
[#2467](https://github.com/open-telemetry/opentelemetry-cpp/pull/2467)
* [EXPORTER] Add option to disable Prometheus otel_scope_name and
otel_scope_version attributes
[#2451](https://github.com/open-telemetry/opentelemetry-cpp/pull/2451)
* [SEMANTIC CONVENTIONS] Code generation script fails on SELINUX
[#2455](https://github.com/open-telemetry/opentelemetry-cpp/pull/2455)
* [BUILD] Fix removing of NOMINMAX on Windows
[#2449](https://github.com/open-telemetry/opentelemetry-cpp/pull/2449)
* [BUILD] Accept path list in OPENTELEMETRY_EXTERNAL_COMPONENT_PATH
[#2439](https://github.com/open-telemetry/opentelemetry-cpp/pull/2439)
* [BUILD] Remove gmock from GTEST_BOTH_LIBRARIES
[#2437](https://github.com/open-telemetry/opentelemetry-cpp/pull/2437)
* [REMOVAL] Remove option WITH_OTLP_HTTP_SSL_PREVIEW
[#2435](https://github.com/open-telemetry/opentelemetry-cpp/pull/2435)

Important changes:

Breaking changes:

* [REMOVAL] Remove option WITH_OTLP_HTTP_SSL_PREVIEW
[#2435](https://github.com/open-telemetry/opentelemetry-cpp/pull/2435)
* CMake options `WITH_OTLP_HTTP_SSL_PREVIEW`
and `WITH_OTLP_HTTP_SSL_TLS_PREVIEW` are removed.
Building opentelemetry-cpp without SSL support is no longer possible.
* CMake options `WITH_OTLP_HTTP_SSL_PREVIEW` and
`WITH_OTLP_HTTP_SSL_TLS_PREVIEW` are removed. Building opentelemetry-cpp
without SSL support is no longer possible.

## [1.13.0] 2023-12-06

Expand Down
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,16 @@ if(BUILD_TESTING)
# Make sure we are always bootsrapped with vcpkg on Windows
find_package(GTest)
if(NOT (GTEST_FOUND OR GTest_FOUND))
install_windows_deps()
include(${CMAKE_TOOLCHAIN_FILE})
find_package(GTest REQUIRED)
if(DEFINED CMAKE_TOOLCHAIN_FILE)
message(
FATAL_ERROR
"Pleaes install GTest with the CMAKE_TOOLCHAIN_FILE at ${CMAKE_TOOLCHAIN_FILE}"
)
else()
install_windows_deps()
include(${CMAKE_TOOLCHAIN_FILE})
find_package(GTest REQUIRED)
endif()
endif()
else()
# Prefer GTest installed by OS distro, brew or vcpkg package manager
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md)
We meet weekly, and the time of the meeting alternates between Monday at 13:00
PT and Wednesday at 9:00 PT. The meeting is subject to change depending on
contributors' availability. Check the [OpenTelemetry community
calendar](https://calendar.google.com/calendar/embed?src=google.com_b79e3e90j7bbsa2n2p5an5lf60%40group.calendar.google.com)
calendar](https://github.com/open-telemetry/community#calendar)
for specific dates and Zoom meeting links.

Meeting notes are available as a public [Google
Expand Down
40 changes: 39 additions & 1 deletion api/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag")

package(default_visibility = ["//visibility:public"])

Expand All @@ -10,12 +10,39 @@ bool_flag(
build_setting_default = False,
)

CPP_STDLIBS = [
"none",
"best",
"2014",
"2017",
"2020",
"2023",
]

string_flag(
name = "with_cxx_stdlib",
build_setting_default = "best",
values = CPP_STDLIBS,
)

cc_library(
name = "api",
hdrs = glob(["include/**/*.h"]),
defines = select({
":with_external_abseil": ["HAVE_ABSEIL"],
"//conditions:default": [],
}) + select({
":set_cxx_stdlib_none": [],
### automatic selection
":set_cxx_stdlib_best": ["OPENTELEMETRY_STL_VERSION=(__cplusplus/100)"],
# See https://learn.microsoft.com/en-us/cpp/build/reference/zc-cplusplus
":set_cxx_stdlib_best_and_msvc": ["OPENTELEMETRY_STL_VERSION=(_MSVC_LANG/100)"],
### manual selection
":set_cxx_stdlib_2014": ["OPENTELEMETRY_STL_VERSION=2014"],
":set_cxx_stdlib_2017": ["OPENTELEMETRY_STL_VERSION=2017"],
":set_cxx_stdlib_2020": ["OPENTELEMETRY_STL_VERSION=2020"],
":set_cxx_stdlib_2023": ["OPENTELEMETRY_STL_VERSION=2023"],
"//conditions:default": [],
}),
strip_include_prefix = "include",
tags = ["api"],
Expand All @@ -33,3 +60,14 @@ config_setting(
name = "with_external_abseil",
flag_values = {":with_abseil": "true"},
)

[config_setting(
name = "set_cxx_stdlib_%s" % v,
flag_values = {":with_cxx_stdlib": v},
) for v in CPP_STDLIBS]

config_setting(
name = "set_cxx_stdlib_best_and_msvc",
constraint_values = ["@bazel_tools//tools/cpp:msvc"],
flag_values = {":with_cxx_stdlib": "best"},
)
3 changes: 3 additions & 0 deletions api/include/opentelemetry/common/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,19 @@ point.
#if defined(__clang__)

# define OPENTELEMETRY_API_SINGLETON __attribute__((visibility("default")))
# define OPENTELEMETRY_LOCAL_SYMBOL __attribute__((visibility("hidden")))

#elif defined(__GNUC__)

# define OPENTELEMETRY_API_SINGLETON __attribute__((visibility("default")))
# define OPENTELEMETRY_LOCAL_SYMBOL __attribute__((visibility("hidden")))

#else

/* Add support for other compilers here. */

# define OPENTELEMETRY_API_SINGLETON
# define OPENTELEMETRY_LOCAL_SYMBOL

#endif

Expand Down
12 changes: 7 additions & 5 deletions api/include/opentelemetry/trace/propagation/detail/hex.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,17 @@ inline bool HexToBinary(nostd::string_view hex, uint8_t *buffer, size_t buffer_s
int64_t buffer_pos = int64_t(buffer_size) - (hex_size + 1) / 2;
int64_t last_hex_pos = hex_size - 1;

int64_t i = 0;
for (; i < last_hex_pos; i += 2)
bool is_hex_size_odd = (hex_size % 2) == 1;
int64_t i = 0;

if (is_hex_size_odd)
{
buffer[buffer_pos++] = (HexToInt(hex[i]) << 4) | HexToInt(hex[i + 1]);
buffer[buffer_pos++] = HexToInt(hex[i++]);
}

if (i == last_hex_pos)
for (; i < last_hex_pos; i += 2)
{
buffer[buffer_pos] = HexToInt(hex[i]);
buffer[buffer_pos++] = (HexToInt(hex[i]) << 4) | HexToInt(hex[i + 1]);
}

return true;
Expand Down
4 changes: 2 additions & 2 deletions api/include/opentelemetry/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
# define OPENTELEMETRY_ABI_VERSION_NO 1
#endif

#define OPENTELEMETRY_VERSION "1.13.0"
#define OPENTELEMETRY_VERSION "1.14.0"
#define OPENTELEMETRY_VERSION_MAJOR 1
#define OPENTELEMETRY_VERSION_MINOR 13
#define OPENTELEMETRY_VERSION_MINOR 14
#define OPENTELEMETRY_VERSION_PATCH 0

#define OPENTELEMETRY_ABI_VERSION OPENTELEMETRY_STRINGIFY(OPENTELEMETRY_ABI_VERSION_NO)
Expand Down
2 changes: 2 additions & 0 deletions api/test/trace/propagation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

add_subdirectory(detail)

foreach(testname http_text_format_test b3_propagation_test)
add_executable(${testname} "${testname}.cc")
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
Expand Down
20 changes: 20 additions & 0 deletions api/test/trace/propagation/detail/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark")

cc_test(
name = "hex_test",
srcs = [
"hex_test.cc",
],
tags = [
"api",
"test",
"trace",
],
deps = [
"//api",
"@com_google_googletest//:gtest_main",
],
)
12 changes: 12 additions & 0 deletions api/test/trace/propagation/detail/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

foreach(testname hex_test)
add_executable(${testname} "${testname}.cc")
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(
TARGET ${testname}
TEST_PREFIX trace.
TEST_LIST ${testname})
endforeach()
42 changes: 42 additions & 0 deletions api/test/trace/propagation/detail/hex_test.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include "opentelemetry/trace/propagation/detail/hex.h"

#include <map>

#include <gtest/gtest.h>

using namespace opentelemetry;

TEST(HexTest, ConvertOddLength)
{
const int kLength = 16;
std::string trace_id_hex = "78cfcfec62ae9e9";
uint8_t trace_id[kLength];
trace::propagation::detail::HexToBinary(trace_id_hex, trace_id, sizeof(trace_id));

const uint8_t expected_trace_id[kLength] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x7, 0x8c, 0xfc, 0xfe, 0xc6, 0x2a, 0xe9, 0xe9};

for (int i = 0; i < kLength; ++i)
{
EXPECT_EQ(trace_id[i], expected_trace_id[i]);
}
}

TEST(HexTest, ConvertEvenLength)
{
const int kLength = 16;
std::string trace_id_hex = "078cfcfec62ae9e9";
uint8_t trace_id[kLength];
trace::propagation::detail::HexToBinary(trace_id_hex, trace_id, sizeof(trace_id));

const uint8_t expected_trace_id[kLength] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x7, 0x8c, 0xfc, 0xfe, 0xc6, 0x2a, 0xe9, 0xe9};

for (int i = 0; i < kLength; ++i)
{
EXPECT_EQ(trace_id[i], expected_trace_id[i]);
}
}
18 changes: 9 additions & 9 deletions docs/building-with-stdlib.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ Valid values for `OPENTELEMETRY_STL_VERSION` are `2011`, `2014`, `2017`, `2020`

List of compilers that support building with standard library classes:

Compiler | Language standard | Notes
-------------------|-------------------|-------------------
Visual Studio 2015 | C++14 | requires `gsl::span` for `std::span` implementation
Visual Studio 2017 | C++17 | requires `gsl::span` for `std::span` implementation
Visual Studio 2019 | C++20 |
Xcode 11.x | C++17 | requires `gsl::span` for `std::span` implementation
Xcode 12.x | C++20 |
gcc-7 | C++17 | requires `gsl::span` for `std::span` implementation
gcc-9+ | C++20 |
| Compiler | Language standard | Notes |
| ------------------ | ----------------- | --------------------------------------------------- |
| Visual Studio 2015 | C++14 | requires `gsl::span` for `std::span` implementation |
| Visual Studio 2017 | C++17 | requires `gsl::span` for `std::span` implementation |
| Visual Studio 2019 | C++20 | |
| Xcode 11.x | C++17 | requires `gsl::span` for `std::span` implementation |
| Xcode 12.x | C++20 | |
| gcc-7 | C++17 | requires `gsl::span` for `std::span` implementation |
| gcc-9+ | C++20 | |

If SDK is compiled without standard library classes, then `nostd::variant`
implementation internally uses a private snapshot of [Abseil
Expand Down
2 changes: 1 addition & 1 deletion docs/public/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
author = 'OpenTelemetry authors'

# The full version, including alpha/beta/rc tags
release = "1.13.0"
release = "1.14.0"

# Run sphinx on subprojects and copy output
# -----------------------------------------
Expand Down
Loading

0 comments on commit df13b50

Please sign in to comment.