Skip to content

Commit

Permalink
Merge remote-tracking branch 'github/main' into fix_lifetime_in_log_r…
Browse files Browse the repository at this point in the history
…ecord
  • Loading branch information
owent committed Dec 20, 2024
2 parents 4327f87 + 4998eb1 commit 2f89435
Show file tree
Hide file tree
Showing 34 changed files with 1,122 additions and 255 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ jobs:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
run: |
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake tests (without otlp-exporter)
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
run: |
./ci/do_ci.sh cmake.test
Expand Down Expand Up @@ -263,15 +263,15 @@ jobs:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
run: |
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake tests (without otlp-exporter)
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
run: |
./ci/do_ci.sh cmake.with_async_export.test
Expand Down Expand Up @@ -359,7 +359,7 @@ jobs:

cmake_test_cxx20_clang:
name: CMake C++20 test(Clang with libc++)
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -409,7 +409,7 @@ jobs:

cmake_test_cxx23_clang:
name: CMake C++23 test(Clang with libc++)
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -538,15 +538,15 @@ jobs:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
run: |
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run tests
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
run: ./ci/do_ci.sh cmake.test_example_plugin

bazel_test:
Expand Down Expand Up @@ -858,7 +858,7 @@ jobs:

code_coverage:
name: Code coverage
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -936,8 +936,8 @@ jobs:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
run: |
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
rm -rf third_party
- name: Setup
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
GOOGLETEST_VERSION: 1.12.1
run: |
sudo -E ./ci/setup_googletest.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
readonly WARNING_COUNT=`grep -c "include-what-you-use reported diagnostics:" iwyu.log`
echo "include-what-you-use reported ${WARNING_COUNT} warning(s)"
# Acceptable limit, to decrease over time down to 0
readonly WARNING_LIMIT=10
readonly WARNING_LIMIT=180
# FAIL the build if WARNING_COUNT > WARNING_LIMIT
if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then
exit 1
Expand Down
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ Increment the:

## [Unreleased]

* [SDK] Do not frequently create and destroy http client threads
[#3198](https://github.com/open-telemetry/opentelemetry-cpp/pull/3198)

* [SDK] Fix instrumentation scope attributes evaluated in equal method
[#3214](https://github.com/open-telemetry/opentelemetry-cpp/pull/3214)

* [EXPORTER] Fix scope attributes missing from otlp traces metrics
[#3185](https://github.com/open-telemetry/opentelemetry-cpp/pull/3185)

## [1.18 2024-11-25]

* [EXPORTER] Fix crash in ElasticsearchLogRecordExporter
Expand Down Expand Up @@ -149,9 +158,6 @@ Increment the:
* [bazel] Update opentelemetry-proto in MODULE.bazel
[#3163](https://github.com/open-telemetry/opentelemetry-cpp/pull/3163)

* [EXPORTER] Fix scope attributes missing from otlp traces metrics
[#3185](https://github.com/open-telemetry/opentelemetry-cpp/pull/3185)

Important changes:

* [API] Jaeger Propagator should not be deprecated
Expand Down
31 changes: 31 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,37 @@ if(BUILD_TESTING)
endif()
message(STATUS "GTEST_INCLUDE_DIRS = ${GTEST_INCLUDE_DIRS}")
message(STATUS "GTEST_BOTH_LIBRARIES = ${GTEST_BOTH_LIBRARIES}")

# Try to find gmock
if(NOT GMOCK_LIB AND TARGET GTest::gmock)
set(GMOCK_LIB GTest::gmock)
elseif(MSVC)
# Explicitly specify that we consume GTest from shared library. The rest of
# code logic below determines whether we link Release or Debug flavor of the
# library. These flavors have different prefix on Windows, gmock and gmockd
# respectively.
add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1)
if(GMOCK_LIB)
# unset GMOCK_LIB to force find_library to redo the lookup, as the cached
# entry could cause linking to incorrect flavor of gmock and leading to
# runtime error.
unset(GMOCK_LIB CACHE)
endif()
endif()
if(NOT GMOCK_LIB)
if(MSVC AND CMAKE_BUILD_TYPE STREQUAL "Debug")
find_library(GMOCK_LIB gmockd PATH_SUFFIXES lib)
else()
find_library(GMOCK_LIB gmock PATH_SUFFIXES lib)
endif()
# Reset GMOCK_LIB if it was not found, or some target may link
# GMOCK_LIB-NOTFOUND
if(NOT GMOCK_LIB)
unset(GMOCK_LIB)
unset(GMOCK_LIB CACHE)
endif()
endif()

enable_testing()
if(WITH_BENCHMARK)
# Benchmark respects the CMAKE_PREFIX_PATH
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "curl", version = "8.8.0")
bazel_dep(name = "grpc", version = "1.63.1.bcr.1", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "github_nlohmann_json")
bazel_dep(name = "opentelemetry-proto", version = "1.4.0", repo_name = "com_github_opentelemetry_proto")
bazel_dep(name = "opentelemetry-proto", version = "1.5.0", repo_name = "com_github_opentelemetry_proto")
bazel_dep(name = "opentracing-cpp", version = "1.6.0", repo_name = "com_github_opentracing")
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "prometheus-cpp", version = "1.3.0", repo_name = "com_github_jupp0r_prometheus_cpp")
Expand Down
12 changes: 12 additions & 0 deletions api/include/opentelemetry/detail/preprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@

#define OPENTELEMETRY_CONCAT(A, B) OPENTELEMETRY_CONCAT_(A, B)
#define OPENTELEMETRY_CONCAT_(A, B) A##B

// Import the C++20 feature-test macros
#ifdef __has_include
# if __has_include(<version>)
# include <version>
# endif
#elif defined(_MSC_VER) && ((defined(__cplusplus) && __cplusplus >= 202002L) || \
(defined(_MSVC_LANG) && _MSVC_LANG >= 202002L))
# if _MSC_VER >= 1922
# include <version>
# endif
#endif
2 changes: 1 addition & 1 deletion api/include/opentelemetry/semconv/incubating/hw_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static inline nostd::shared_ptr<metrics::ObservableInstrument> CreateAsyncDouble
* states <p>
* @code hw.status @endcode is currently specified as an <em>UpDownCounter</em> but would ideally be
* represented using a <a
* href="https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#stateset"><em>StateSet</em>
* href="https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#stateset"><em>StateSet</em>
* as defined in OpenMetrics</a>. This semantic convention will be updated once <em>StateSet</em> is
* specified in OpenTelemetry. This planned change is not expected to have any consequence on the
* way users query their timeseries backend to retrieve the values of @code hw.status @endcode over
Expand Down
106 changes: 50 additions & 56 deletions api/test/singleton/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,53 @@

include(GoogleTest)

# Header only singletons are not available in windows yet.

if(NOT WIN32)

add_library(component_a STATIC component_a.cc)
target_link_libraries(component_a opentelemetry_api)

add_library(component_b STATIC component_b.cc)
target_link_libraries(component_b opentelemetry_api)

add_library(component_c SHARED component_c.cc)
set_target_properties(component_c PROPERTIES CXX_VISIBILITY_PRESET default)
target_link_libraries(component_c opentelemetry_api)

add_library(component_d SHARED component_d.cc)
set_target_properties(component_d PROPERTIES CXX_VISIBILITY_PRESET hidden)
target_link_libraries(component_d opentelemetry_api)

add_library(component_e SHARED component_e.cc)
set_target_properties(component_e PROPERTIES CXX_VISIBILITY_PRESET default)
target_link_libraries(component_e opentelemetry_api)

add_library(component_f SHARED component_f.cc)
set_target_properties(component_f PROPERTIES CXX_VISIBILITY_PRESET hidden)
target_link_libraries(component_f opentelemetry_api)

add_library(component_g SHARED component_g.cc)
set_target_properties(component_g PROPERTIES CXX_VISIBILITY_PRESET default)
target_link_libraries(component_g opentelemetry_api)

add_library(component_h SHARED component_h.cc)
set_target_properties(component_h PROPERTIES CXX_VISIBILITY_PRESET hidden)
target_link_libraries(component_h opentelemetry_api)

add_executable(singleton_test singleton_test.cc)

# Not linking with component_g and component_h on purpose
target_link_libraries(
singleton_test
component_a
component_b
component_c
component_d
component_e
component_f
${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${CMAKE_DL_LIBS}
opentelemetry_api)

gtest_add_tests(
TARGET singleton_test
TEST_PREFIX singleton.
TEST_LIST singleton_test)

endif()
add_library(component_a STATIC component_a.cc)
target_link_libraries(component_a opentelemetry_api)

add_library(component_b STATIC component_b.cc)
target_link_libraries(component_b opentelemetry_api)

add_library(component_c SHARED component_c.cc)
set_target_properties(component_c PROPERTIES CXX_VISIBILITY_PRESET default)
target_link_libraries(component_c opentelemetry_api)

add_library(component_d SHARED component_d.cc)
set_target_properties(component_d PROPERTIES CXX_VISIBILITY_PRESET hidden)
target_link_libraries(component_d opentelemetry_api)

add_library(component_e SHARED component_e.cc)
set_target_properties(component_e PROPERTIES CXX_VISIBILITY_PRESET default)
target_link_libraries(component_e opentelemetry_api)

add_library(component_f SHARED component_f.cc)
set_target_properties(component_f PROPERTIES CXX_VISIBILITY_PRESET hidden)
target_link_libraries(component_f opentelemetry_api)

add_library(component_g SHARED component_g.cc)
set_target_properties(component_g PROPERTIES CXX_VISIBILITY_PRESET default)
target_link_libraries(component_g opentelemetry_api)

add_library(component_h SHARED component_h.cc)
set_target_properties(component_h PROPERTIES CXX_VISIBILITY_PRESET hidden)
target_link_libraries(component_h opentelemetry_api)

add_executable(singleton_test singleton_test.cc)

# Not linking with component_g and component_h on purpose
target_link_libraries(
singleton_test
component_a
component_b
component_c
component_d
component_e
component_f
${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${CMAKE_DL_LIBS}
opentelemetry_api)

gtest_add_tests(
TARGET singleton_test
TEST_PREFIX singleton.
TEST_LIST singleton_test)
Loading

0 comments on commit 2f89435

Please sign in to comment.