Skip to content

Commit 2f89435

Browse files
committed
Merge remote-tracking branch 'github/main' into fix_lifetime_in_log_record
2 parents 4327f87 + 4998eb1 commit 2f89435

File tree

34 files changed

+1122
-255
lines changed

34 files changed

+1122
-255
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ jobs:
4949
submodules: 'recursive'
5050
- name: setup
5151
env:
52-
CC: /usr/bin/gcc-10
53-
CXX: /usr/bin/g++-10
52+
CC: /usr/bin/gcc-12
53+
CXX: /usr/bin/g++-12
5454
run: |
5555
sudo -E ./ci/setup_googletest.sh
5656
sudo -E ./ci/setup_ci_environment.sh
5757
- name: run cmake tests (without otlp-exporter)
5858
env:
59-
CC: /usr/bin/gcc-10
60-
CXX: /usr/bin/g++-10
59+
CC: /usr/bin/gcc-12
60+
CXX: /usr/bin/g++-12
6161
run: |
6262
./ci/do_ci.sh cmake.test
6363
@@ -263,15 +263,15 @@ jobs:
263263
submodules: 'recursive'
264264
- name: setup
265265
env:
266-
CC: /usr/bin/gcc-10
267-
CXX: /usr/bin/g++-10
266+
CC: /usr/bin/gcc-12
267+
CXX: /usr/bin/g++-12
268268
run: |
269269
sudo -E ./ci/setup_googletest.sh
270270
sudo -E ./ci/setup_ci_environment.sh
271271
- name: run cmake tests (without otlp-exporter)
272272
env:
273-
CC: /usr/bin/gcc-10
274-
CXX: /usr/bin/g++-10
273+
CC: /usr/bin/gcc-12
274+
CXX: /usr/bin/g++-12
275275
run: |
276276
./ci/do_ci.sh cmake.with_async_export.test
277277
@@ -359,7 +359,7 @@ jobs:
359359

360360
cmake_test_cxx20_clang:
361361
name: CMake C++20 test(Clang with libc++)
362-
runs-on: ubuntu-latest
362+
runs-on: ubuntu-22.04
363363
steps:
364364
- uses: actions/checkout@v4
365365
with:
@@ -409,7 +409,7 @@ jobs:
409409

410410
cmake_test_cxx23_clang:
411411
name: CMake C++23 test(Clang with libc++)
412-
runs-on: ubuntu-latest
412+
runs-on: ubuntu-22.04
413413
steps:
414414
- uses: actions/checkout@v4
415415
with:
@@ -538,15 +538,15 @@ jobs:
538538
submodules: 'recursive'
539539
- name: setup
540540
env:
541-
CC: /usr/bin/gcc-10
542-
CXX: /usr/bin/g++-10
541+
CC: /usr/bin/gcc-12
542+
CXX: /usr/bin/g++-12
543543
run: |
544544
sudo -E ./ci/setup_googletest.sh
545545
sudo -E ./ci/setup_ci_environment.sh
546546
- name: run tests
547547
env:
548-
CC: /usr/bin/gcc-10
549-
CXX: /usr/bin/g++-10
548+
CC: /usr/bin/gcc-12
549+
CXX: /usr/bin/g++-12
550550
run: ./ci/do_ci.sh cmake.test_example_plugin
551551

552552
bazel_test:
@@ -858,7 +858,7 @@ jobs:
858858

859859
code_coverage:
860860
name: Code coverage
861-
runs-on: ubuntu-latest
861+
runs-on: ubuntu-22.04
862862
steps:
863863
- uses: actions/checkout@v4
864864
with:
@@ -936,8 +936,8 @@ jobs:
936936
submodules: 'recursive'
937937
- name: setup
938938
env:
939-
CC: /usr/bin/gcc-10
940-
CXX: /usr/bin/g++-10
939+
CC: /usr/bin/gcc-12
940+
CXX: /usr/bin/g++-12
941941
run: |
942942
sudo -E ./ci/setup_googletest.sh
943943
sudo -E ./ci/setup_ci_environment.sh

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
rm -rf third_party
2121
- name: Setup
2222
env:
23-
CC: /usr/bin/gcc-10
24-
CXX: /usr/bin/g++-10
23+
CC: /usr/bin/gcc-12
24+
CXX: /usr/bin/g++-12
2525
GOOGLETEST_VERSION: 1.12.1
2626
run: |
2727
sudo -E ./ci/setup_googletest.sh

.github/workflows/iwyu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
readonly WARNING_COUNT=`grep -c "include-what-you-use reported diagnostics:" iwyu.log`
6868
echo "include-what-you-use reported ${WARNING_COUNT} warning(s)"
6969
# Acceptable limit, to decrease over time down to 0
70-
readonly WARNING_LIMIT=10
70+
readonly WARNING_LIMIT=180
7171
# FAIL the build if WARNING_COUNT > WARNING_LIMIT
7272
if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then
7373
exit 1

CHANGELOG.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ Increment the:
1515

1616
## [Unreleased]
1717

18+
* [SDK] Do not frequently create and destroy http client threads
19+
[#3198](https://github.com/open-telemetry/opentelemetry-cpp/pull/3198)
20+
21+
* [SDK] Fix instrumentation scope attributes evaluated in equal method
22+
[#3214](https://github.com/open-telemetry/opentelemetry-cpp/pull/3214)
23+
24+
* [EXPORTER] Fix scope attributes missing from otlp traces metrics
25+
[#3185](https://github.com/open-telemetry/opentelemetry-cpp/pull/3185)
26+
1827
## [1.18 2024-11-25]
1928

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

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

157163
* [API] Jaeger Propagator should not be deprecated

CMakeLists.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,37 @@ if(BUILD_TESTING)
645645
endif()
646646
message(STATUS "GTEST_INCLUDE_DIRS = ${GTEST_INCLUDE_DIRS}")
647647
message(STATUS "GTEST_BOTH_LIBRARIES = ${GTEST_BOTH_LIBRARIES}")
648+
649+
# Try to find gmock
650+
if(NOT GMOCK_LIB AND TARGET GTest::gmock)
651+
set(GMOCK_LIB GTest::gmock)
652+
elseif(MSVC)
653+
# Explicitly specify that we consume GTest from shared library. The rest of
654+
# code logic below determines whether we link Release or Debug flavor of the
655+
# library. These flavors have different prefix on Windows, gmock and gmockd
656+
# respectively.
657+
add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1)
658+
if(GMOCK_LIB)
659+
# unset GMOCK_LIB to force find_library to redo the lookup, as the cached
660+
# entry could cause linking to incorrect flavor of gmock and leading to
661+
# runtime error.
662+
unset(GMOCK_LIB CACHE)
663+
endif()
664+
endif()
665+
if(NOT GMOCK_LIB)
666+
if(MSVC AND CMAKE_BUILD_TYPE STREQUAL "Debug")
667+
find_library(GMOCK_LIB gmockd PATH_SUFFIXES lib)
668+
else()
669+
find_library(GMOCK_LIB gmock PATH_SUFFIXES lib)
670+
endif()
671+
# Reset GMOCK_LIB if it was not found, or some target may link
672+
# GMOCK_LIB-NOTFOUND
673+
if(NOT GMOCK_LIB)
674+
unset(GMOCK_LIB)
675+
unset(GMOCK_LIB CACHE)
676+
endif()
677+
endif()
678+
648679
enable_testing()
649680
if(WITH_BENCHMARK)
650681
# Benchmark respects the CMAKE_PREFIX_PATH

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ bazel_dep(name = "bazel_skylib", version = "1.5.0")
1313
bazel_dep(name = "curl", version = "8.8.0")
1414
bazel_dep(name = "grpc", version = "1.63.1.bcr.1", repo_name = "com_github_grpc_grpc")
1515
bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "github_nlohmann_json")
16-
bazel_dep(name = "opentelemetry-proto", version = "1.4.0", repo_name = "com_github_opentelemetry_proto")
16+
bazel_dep(name = "opentelemetry-proto", version = "1.5.0", repo_name = "com_github_opentelemetry_proto")
1717
bazel_dep(name = "opentracing-cpp", version = "1.6.0", repo_name = "com_github_opentracing")
1818
bazel_dep(name = "platforms", version = "0.0.8")
1919
bazel_dep(name = "prometheus-cpp", version = "1.3.0", repo_name = "com_github_jupp0r_prometheus_cpp")

api/include/opentelemetry/detail/preprocessor.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,15 @@
1111

1212
#define OPENTELEMETRY_CONCAT(A, B) OPENTELEMETRY_CONCAT_(A, B)
1313
#define OPENTELEMETRY_CONCAT_(A, B) A##B
14+
15+
// Import the C++20 feature-test macros
16+
#ifdef __has_include
17+
# if __has_include(<version>)
18+
# include <version>
19+
# endif
20+
#elif defined(_MSC_VER) && ((defined(__cplusplus) && __cplusplus >= 202002L) || \
21+
(defined(_MSVC_LANG) && _MSVC_LANG >= 202002L))
22+
# if _MSC_VER >= 1922
23+
# include <version>
24+
# endif
25+
#endif

api/include/opentelemetry/semconv/incubating/hw_metrics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static inline nostd::shared_ptr<metrics::ObservableInstrument> CreateAsyncDouble
132132
* states <p>
133133
* @code hw.status @endcode is currently specified as an <em>UpDownCounter</em> but would ideally be
134134
* represented using a <a
135-
* href="https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#stateset"><em>StateSet</em>
135+
* href="https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#stateset"><em>StateSet</em>
136136
* as defined in OpenMetrics</a>. This semantic convention will be updated once <em>StateSet</em> is
137137
* specified in OpenTelemetry. This planned change is not expected to have any consequence on the
138138
* way users query their timeseries backend to retrieve the values of @code hw.status @endcode over

api/test/singleton/CMakeLists.txt

Lines changed: 50 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,53 @@
33

44
include(GoogleTest)
55

6-
# Header only singletons are not available in windows yet.
7-
8-
if(NOT WIN32)
9-
10-
add_library(component_a STATIC component_a.cc)
11-
target_link_libraries(component_a opentelemetry_api)
12-
13-
add_library(component_b STATIC component_b.cc)
14-
target_link_libraries(component_b opentelemetry_api)
15-
16-
add_library(component_c SHARED component_c.cc)
17-
set_target_properties(component_c PROPERTIES CXX_VISIBILITY_PRESET default)
18-
target_link_libraries(component_c opentelemetry_api)
19-
20-
add_library(component_d SHARED component_d.cc)
21-
set_target_properties(component_d PROPERTIES CXX_VISIBILITY_PRESET hidden)
22-
target_link_libraries(component_d opentelemetry_api)
23-
24-
add_library(component_e SHARED component_e.cc)
25-
set_target_properties(component_e PROPERTIES CXX_VISIBILITY_PRESET default)
26-
target_link_libraries(component_e opentelemetry_api)
27-
28-
add_library(component_f SHARED component_f.cc)
29-
set_target_properties(component_f PROPERTIES CXX_VISIBILITY_PRESET hidden)
30-
target_link_libraries(component_f opentelemetry_api)
31-
32-
add_library(component_g SHARED component_g.cc)
33-
set_target_properties(component_g PROPERTIES CXX_VISIBILITY_PRESET default)
34-
target_link_libraries(component_g opentelemetry_api)
35-
36-
add_library(component_h SHARED component_h.cc)
37-
set_target_properties(component_h PROPERTIES CXX_VISIBILITY_PRESET hidden)
38-
target_link_libraries(component_h opentelemetry_api)
39-
40-
add_executable(singleton_test singleton_test.cc)
41-
42-
# Not linking with component_g and component_h on purpose
43-
target_link_libraries(
44-
singleton_test
45-
component_a
46-
component_b
47-
component_c
48-
component_d
49-
component_e
50-
component_f
51-
${GTEST_BOTH_LIBRARIES}
52-
${CMAKE_THREAD_LIBS_INIT}
53-
${CMAKE_DL_LIBS}
54-
opentelemetry_api)
55-
56-
gtest_add_tests(
57-
TARGET singleton_test
58-
TEST_PREFIX singleton.
59-
TEST_LIST singleton_test)
60-
61-
endif()
6+
add_library(component_a STATIC component_a.cc)
7+
target_link_libraries(component_a opentelemetry_api)
8+
9+
add_library(component_b STATIC component_b.cc)
10+
target_link_libraries(component_b opentelemetry_api)
11+
12+
add_library(component_c SHARED component_c.cc)
13+
set_target_properties(component_c PROPERTIES CXX_VISIBILITY_PRESET default)
14+
target_link_libraries(component_c opentelemetry_api)
15+
16+
add_library(component_d SHARED component_d.cc)
17+
set_target_properties(component_d PROPERTIES CXX_VISIBILITY_PRESET hidden)
18+
target_link_libraries(component_d opentelemetry_api)
19+
20+
add_library(component_e SHARED component_e.cc)
21+
set_target_properties(component_e PROPERTIES CXX_VISIBILITY_PRESET default)
22+
target_link_libraries(component_e opentelemetry_api)
23+
24+
add_library(component_f SHARED component_f.cc)
25+
set_target_properties(component_f PROPERTIES CXX_VISIBILITY_PRESET hidden)
26+
target_link_libraries(component_f opentelemetry_api)
27+
28+
add_library(component_g SHARED component_g.cc)
29+
set_target_properties(component_g PROPERTIES CXX_VISIBILITY_PRESET default)
30+
target_link_libraries(component_g opentelemetry_api)
31+
32+
add_library(component_h SHARED component_h.cc)
33+
set_target_properties(component_h PROPERTIES CXX_VISIBILITY_PRESET hidden)
34+
target_link_libraries(component_h opentelemetry_api)
35+
36+
add_executable(singleton_test singleton_test.cc)
37+
38+
# Not linking with component_g and component_h on purpose
39+
target_link_libraries(
40+
singleton_test
41+
component_a
42+
component_b
43+
component_c
44+
component_d
45+
component_e
46+
component_f
47+
${GTEST_BOTH_LIBRARIES}
48+
${CMAKE_THREAD_LIBS_INIT}
49+
${CMAKE_DL_LIBS}
50+
opentelemetry_api)
51+
52+
gtest_add_tests(
53+
TARGET singleton_test
54+
TEST_PREFIX singleton.
55+
TEST_LIST singleton_test)

0 commit comments

Comments
 (0)