From d1143ab37ef7a7e9bbc4289513dbd21b9fe134d2 Mon Sep 17 00:00:00 2001 From: Thomas-Barbier-1A Date: Tue, 5 Dec 2023 10:54:00 +0100 Subject: [PATCH 1/2] [BUILD] 'uint8_t' not declared in this scope with gcc 13.2.1 (#2423) --- api/include/opentelemetry/trace/propagation/detail/hex.h | 1 + 1 file changed, 1 insertion(+) diff --git a/api/include/opentelemetry/trace/propagation/detail/hex.h b/api/include/opentelemetry/trace/propagation/detail/hex.h index c8bd58f8b8..157f5ec42a 100644 --- a/api/include/opentelemetry/trace/propagation/detail/hex.h +++ b/api/include/opentelemetry/trace/propagation/detail/hex.h @@ -4,6 +4,7 @@ #pragma once #include +#include #include #include "opentelemetry/nostd/string_view.h" From a86f8f094a5d63a214a34bc528dd88b7ccf69cac Mon Sep 17 00:00:00 2001 From: Kyle L Date: Tue, 5 Dec 2023 14:39:39 -0500 Subject: [PATCH 2/2] [BUILD] Improve the handling of OPENTELEMETRY_HAVE_WORKING_REGEX. (#2430) --- api/include/opentelemetry/trace/trace_state.h | 6 ++++-- sdk/include/opentelemetry/sdk/metrics/view/predicate.h | 2 +- sdk/src/metrics/instrument_metadata_validator.cc | 2 +- sdk/test/metrics/histogram_test.cc | 6 +++--- sdk/test/metrics/view_registry_test.cc | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/api/include/opentelemetry/trace/trace_state.h b/api/include/opentelemetry/trace/trace_state.h index f424b01997..8a25f4da5c 100644 --- a/api/include/opentelemetry/trace/trace_state.h +++ b/api/include/opentelemetry/trace/trace_state.h @@ -14,7 +14,7 @@ #include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/version.h" -#if defined(OPENTELEMETRY_HAVE_WORKING_REGEX) +#if OPENTELEMETRY_HAVE_WORKING_REGEX # include #endif @@ -246,6 +246,7 @@ class OPENTELEMETRY_EXPORT TraceState return str.substr(left, right - left + 1); } +#if OPENTELEMETRY_HAVE_WORKING_REGEX static bool IsValidKeyRegEx(nostd::string_view key) { static std::regex reg_key("^[a-z0-9][a-z0-9*_\\-/]{0,255}$"); @@ -267,7 +268,7 @@ class OPENTELEMETRY_EXPORT TraceState // Need to benchmark without regex, as a string object is created here. return std::regex_match(std::string(value.data(), value.size()), reg_value); } - +#else static bool IsValidKeyNonRegEx(nostd::string_view key) { if (key.empty() || key.size() > kKeyMaxSize || !IsLowerCaseAlphaOrDigit(key[0])) @@ -307,6 +308,7 @@ class OPENTELEMETRY_EXPORT TraceState } return true; } +#endif static bool IsLowerCaseAlphaOrDigit(char c) { return isdigit(c) || islower(c); } diff --git a/sdk/include/opentelemetry/sdk/metrics/view/predicate.h b/sdk/include/opentelemetry/sdk/metrics/view/predicate.h index 5346a753ff..cfa1b16eb3 100644 --- a/sdk/include/opentelemetry/sdk/metrics/view/predicate.h +++ b/sdk/include/opentelemetry/sdk/metrics/view/predicate.h @@ -8,7 +8,7 @@ #include "opentelemetry/nostd/string_view.h" #include "opentelemetry/sdk/common/global_log_handler.h" -#if defined(OPENTELEMETRY_HAVE_WORKING_REGEX) +#if OPENTELEMETRY_HAVE_WORKING_REGEX # include #endif diff --git a/sdk/src/metrics/instrument_metadata_validator.cc b/sdk/src/metrics/instrument_metadata_validator.cc index ff963c3dd1..0b00404447 100644 --- a/sdk/src/metrics/instrument_metadata_validator.cc +++ b/sdk/src/metrics/instrument_metadata_validator.cc @@ -8,7 +8,7 @@ #include #include -#if defined(OPENTELEMETRY_HAVE_WORKING_REGEX) +#if OPENTELEMETRY_HAVE_WORKING_REGEX # include #endif diff --git a/sdk/test/metrics/histogram_test.cc b/sdk/test/metrics/histogram_test.cc index a11a9c1f59..4daceb685b 100644 --- a/sdk/test/metrics/histogram_test.cc +++ b/sdk/test/metrics/histogram_test.cc @@ -13,7 +13,7 @@ #include -#if defined(OPENTELEMETRY_HAVE_WORKING_REGEX) +#if OPENTELEMETRY_HAVE_WORKING_REGEX # include #endif @@ -73,7 +73,7 @@ TEST(Histogram, Double) actual.counts_); } -#if (OPENTELEMETRY_HAVE_WORKING_REGEX) +#if OPENTELEMETRY_HAVE_WORKING_REGEX // FIXME - View Preficate search is only supported through regex TEST(Histogram, DoubleCustomBuckets) { @@ -188,7 +188,7 @@ TEST(Histogram, UInt64) actual.counts_); } -#if (OPENTELEMETRY_HAVE_WORKING_REGEX) +#if OPENTELEMETRY_HAVE_WORKING_REGEX // FIXME - View Preficate search is only supported through regex TEST(Histogram, UInt64CustomBuckets) { diff --git a/sdk/test/metrics/view_registry_test.cc b/sdk/test/metrics/view_registry_test.cc index 49e475a9f1..fb188e7124 100644 --- a/sdk/test/metrics/view_registry_test.cc +++ b/sdk/test/metrics/view_registry_test.cc @@ -8,7 +8,7 @@ #include -#if defined(OPENTELEMETRY_HAVE_WORKING_REGEX) +#if OPENTELEMETRY_HAVE_WORKING_REGEX # include #endif