Skip to content

Commit b7b66ec

Browse files
committed
Merge branch 'main' into poc_config_yaml
2 parents 75e3816 + 4d9cc28 commit b7b66ec

File tree

158 files changed

+16267
-837
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+16267
-837
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,9 +910,9 @@ jobs:
910910
CXX: /usr/bin/g++-10
911911
run: ./ci/do_ci.sh code.coverage
912912
- name: upload report
913-
uses: codecov/codecov-action@v4
913+
uses: codecov/codecov-action@v5
914914
with:
915-
file: /home/runner/build/coverage.info
915+
files: /home/runner/build/coverage.info
916916

917917
markdown-lint:
918918
runs-on: ubuntu-latest

.github/workflows/clang-tidy.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ jobs:
4747
CC: clang
4848
CXX: clang++
4949
run: |
50-
mkdir -p build && cd build
5150
echo "Running cmake..."
52-
cmake .. \
51+
cmake -B build \
5352
-DCMAKE_CXX_STANDARD=14 \
5453
-DWITH_STL=CXX14 \
5554
-DWITH_OTLP_HTTP=ON \
@@ -64,22 +63,20 @@ jobs:
6463
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
6564
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
6665
-DWITH_CONFIGURATION=ON \
67-
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
68-
-DCMAKE_CXX_CLANG_TIDY="clang-tidy"
66+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
6967
7068
- name: Run clang-tidy
7169
run: |
72-
cd build
73-
make 2>&1 | tee -a clang-tidy.log || exit 1
70+
cmake --build build --target opentelemetry_proto
71+
jq -r .[].file build/compile_commands.json | grep -vE '/(generated|third_party)/' | xargs -P $(nproc) -n 1 clang-tidy --quiet -p build 2>&1 | tee -a clang-tidy.log
7472
7573
- uses: actions/upload-artifact@v4
7674
with:
7775
name: Logs (clang-tidy)
78-
path: ./build/clang-tidy.log
76+
path: ./clang-tidy.log
7977

8078
- name: Count warnings
8179
run: |
82-
cd build
8380
COUNT=$(grep -c "warning:" clang-tidy.log)
8481
echo "clang-tidy reported ${COUNT} warning(s)"
8582

.github/workflows/cppcheck.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
name: cppcheck
3+
4+
on:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
cppcheck:
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: 'recursive'
17+
18+
- name: Set up dependencies
19+
run: |
20+
sudo apt update -y
21+
sudo apt install -y cppcheck
22+
23+
- name: Run cppcheck
24+
run: |
25+
cppcheck --version | tee cppcheck.log
26+
cppcheck \
27+
--force \
28+
--enable=warning,performance,portability \
29+
--inline-suppr \
30+
--suppress=unknownMacro:exporters/etw/include/opentelemetry/exporters/etw/TraceLoggingDynamic.h \
31+
--language=c++ \
32+
--std=c++14 \
33+
-I api/include \
34+
-I exporters/elasticsearch/include \
35+
-I exporters/etw/include \
36+
-I exporters/memory/include \
37+
-I exporters/ostream/include \
38+
-I exporters/otlp/include \
39+
-I exporters/prometheus/include \
40+
-I exporters/zipkin/include \
41+
-I ext/include \
42+
-I opentracing-shim/include \
43+
-I sdk/include \
44+
-i build \
45+
-i test \
46+
-i third_party \
47+
-j $(nproc) \
48+
. 2>&1 | tee --append cppcheck.log
49+
50+
- uses: actions/upload-artifact@v4
51+
if: success() || failure()
52+
with:
53+
name: Logs (cppcheck)
54+
path: ./cppcheck.log
55+
56+
- name: Count warnings
57+
run: |
58+
set +e
59+
COUNT=`grep -c -E "\[.+\]" cppcheck.log`
60+
echo "cppcheck reported ${COUNT} warning(s)"
61+
# TODO: uncomment to enforce failing the build
62+
# if [ $COUNT -ne 0 ] ; then exit 1 ; fi

CHANGELOG.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,21 @@ Increment the:
1515

1616
## [Unreleased]
1717

18-
* [API] Comply with W3C Trace Context [#3115](https://github.com/open-telemetry/opentelemetry-cpp/pull/3115)
19-
* Also adds CI check to ensure continued compliance
18+
* [API] Comply with W3C Trace Context
19+
[#3115](https://github.com/open-telemetry/opentelemetry-cpp/pull/3115)
2020

2121
* [API] Jaeger Propagator should not be deprecated
2222
[#3086](https://github.com/open-telemetry/opentelemetry-cpp/pull/3086)
2323

24+
* Upgrade to prometheus 1.3.0
25+
[#3122](https://github.com/open-telemetry/opentelemetry-cpp/pull/3122)
26+
27+
* [SEMANTIC CONVENTIONS] Migration to weaver
28+
[#3105](https://github.com/open-telemetry/opentelemetry-cpp/pull/3105)
29+
30+
* [EXPORTER] Allow to share gRPC clients between OTLP exporters.
31+
[#3041](https://github.com/open-telemetry/opentelemetry-cpp/pull/3041)
32+
2433
Important changes:
2534

2635
* [API] Jaeger Propagator should not be deprecated
@@ -32,14 +41,19 @@ Important changes:
3241
as the Jaeger propagator can be used without the (now removed)
3342
Jaeger exporter.
3443

35-
* Upgrade to prometheus 1.3.0
36-
[#3122](https://github.com/open-telemetry/opentelemetry-cpp/pull/3122)
37-
3844
* [EXPORTER] Change log resources location for ElasticsearchLogRecordExporter
3945
[#3119](https://github.com/open-telemetry/opentelemetry-cpp/pull/3131)
4046

4147
* Moved from `root/resources` to `root`
4248

49+
* [SEMANTIC CONVENTIONS] Migration to weaver
50+
[#3105](https://github.com/open-telemetry/opentelemetry-cpp/pull/3105)
51+
52+
* `semantic_convention.h` header files are deprecated,
53+
replaced by `semconv/xxx_attributes.h` header files,
54+
for each `xxx` semantic attribute group.
55+
* See file DEPRECATED.md for details.
56+
4357
## [1.17 2024-10-07]
4458

4559
* [CI] Add a clang-tidy build

CMakeLists.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ else()
6060
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
6161
set(ARCH x86)
6262
endif()
63+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc")
64+
# AIX will report the processor as 'powerpc' even if building in 64-bit mode
65+
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
66+
set(ARCH ppc64)
67+
else()
68+
set(ARCH ppc32)
69+
endif()
6370
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES
6471
"^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)")
6572
set(ARCH arm64)
@@ -384,14 +391,8 @@ if(WITH_OTLP_GRPC
384391
OR WITH_OTLP_HTTP
385392
OR WITH_OTLP_FILE)
386393
find_package(Protobuf)
387-
if(Protobuf_VERSION AND Protobuf_VERSION VERSION_GREATER_EQUAL "3.22.0")
388-
if(NOT WITH_ABSEIL)
389-
message(
390-
FATAL_ERROR
391-
"Protobuf 3.22 or upper require abseil-cpp(Recommended version: 20230125 or upper)"
392-
)
393-
endif()
394-
endif()
394+
# Protobuf 3.22 or upper require abseil-cpp, we can find it in
395+
# opentelemetry-cpp-config.cmake
395396

396397
if(WITH_OTLP_GRPC)
397398
find_package(gRPC)

DEPRECATED.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,81 @@ N/A
5959
## [Documentation]
6060

6161
N/A
62+
63+
## Semantic conventions
64+
65+
### Header files "semantic_conventions.h"
66+
67+
#### Announcement (semantic_conventions.h)
68+
69+
Deprecation is announced as part of the migration to weaver:
70+
71+
* `Version:` release following opentelemetry-cpp 1.17.0
72+
* `Date:` Nov 9, 2024
73+
* `PR:` [PR 3105](https://github.com/open-telemetry/opentelemetry-cpp/pull/3105)
74+
75+
#### Motivation (semantic_conventions.h)
76+
77+
The header files for semantic conventions are generated automatically.
78+
The tooling to generate these files is changing:
79+
80+
* before, the build-tool repository was used
81+
* now, the weaver repository is used
82+
83+
Changes in tooling allows to generate code that is better organized,
84+
with dedicated header files per group of semantic conventions,
85+
instead of a single header file for everything.
86+
87+
#### Scope (semantic_conventions.h)
88+
89+
The following files:
90+
91+
* `api/include/opentelemetry/trace/semantic_conventions.h`
92+
* `sdk/include/opentelemetry/sdk/resource/semantic_conventions.h`
93+
94+
are now deprecated.
95+
96+
They correspond to semantic conventions v1.27.0,
97+
and will no longer be maintained up to date.
98+
99+
These files will be removed in the future.
100+
101+
#### Mitigation (semantic_conventions.h)
102+
103+
Two things have changed:
104+
105+
* the header file to use
106+
* the symbol name to use.
107+
108+
Before, the semantic convention for `url.full` was:
109+
110+
* declared in file `semantic_conventions.h`
111+
* declared as symbol `SemanticConventions::kUrlFull`
112+
113+
Now, the `url.full` convention, which is part or the `url` group, is:
114+
115+
* declared in file `semconv/url_attributes.h`
116+
* declared as symbol `semconv::url::kUrlFull`
117+
118+
Application code that uses semantic conventions must be adjusted
119+
accordingly.
120+
121+
In addition, semantic conventions that are not marked as stable
122+
are generated in a different header file, placed under directory
123+
`incubating`, to better separate stable and non stable code.
124+
125+
For example, file `semconv/incubating/url_attributes.h`
126+
defines `semconv::url::kUrlDomain`,
127+
which is not marked as stable in semconv v1.27.0
128+
129+
#### Planned removal (semantic_conventions.h)
130+
131+
The following files:
132+
133+
* `api/include/opentelemetry/trace/semantic_conventions.h`
134+
* `sdk/include/opentelemetry/sdk/resource/semantic_conventions.h`
135+
136+
will be removed.
137+
138+
The removal date is planned for July 1, 2025.
139+
This allows more than six months for applications to adjust.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Notes on Abseil Variant implementation
22

3-
This is a snapshot of Abseil Variant `absl::variant` from Abseil
4-
`v2020-03-03#8`.
3+
This is a snapshot of Abseil Variant
4+
`absl::OTABSL_OPTION_NAMESPACE_NAME::variant` from Abseil `v2020-03-03#8`.

api/include/opentelemetry/nostd/internal/absl/base/config.h

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
// namespace absl {
8585
// OTABSL_NAMESPACE_BEGIN
8686
//
87-
// void Foo(); // absl::Foo().
87+
// void Foo(); // absl::OTABSL_OPTION_NAMESPACE_NAME::Foo().
8888
//
8989
// OTABSL_NAMESPACE_END
9090
// } // namespace absl
@@ -94,40 +94,32 @@
9494
// not support forward declarations of its own types, nor does it support
9595
// user-provided specialization of Abseil templates. Code that violates these
9696
// rules may be broken without warning.)
97-
#if !defined(OTABSL_OPTION_USE_INLINE_NAMESPACE) || \
98-
!defined(OTABSL_OPTION_INLINE_NAMESPACE_NAME)
97+
#if !defined(OTABSL_OPTION_NAMESPACE_NAME)
9998
#error options.h is misconfigured.
10099
#endif
101100

102-
// Check that OTABSL_OPTION_INLINE_NAMESPACE_NAME is neither "head" nor ""
103-
#if defined(__cplusplus) && OTABSL_OPTION_USE_INLINE_NAMESPACE == 1
101+
// Check that OTABSL_OPTION_NAMESPACE_NAME is neither "head" nor ""
102+
#if defined(__cplusplus)
104103

105104
#define OTABSL_INTERNAL_INLINE_NAMESPACE_STR \
106-
OTABSL_INTERNAL_TOKEN_STR(OTABSL_OPTION_INLINE_NAMESPACE_NAME)
105+
OTABSL_INTERNAL_TOKEN_STR(OTABSL_OPTION_NAMESPACE_NAME)
107106

108107
static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != '\0',
109-
"options.h misconfigured: OTABSL_OPTION_INLINE_NAMESPACE_NAME must "
108+
"options.h misconfigured: OTABSL_OPTION_NAMESPACE_NAME must "
110109
"not be empty.");
111110
static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
112111
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[1] != 'e' ||
113112
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[2] != 'a' ||
114113
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[3] != 'd' ||
115114
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[4] != '\0',
116-
"options.h misconfigured: OTABSL_OPTION_INLINE_NAMESPACE_NAME must "
115+
"options.h misconfigured: OTABSL_OPTION_NAMESPACE_NAME must "
117116
"be changed to a new, unique identifier name.");
118117

119118
#endif
120119

121-
#if OTABSL_OPTION_USE_INLINE_NAMESPACE == 0
122-
#define OTABSL_NAMESPACE_BEGIN
123-
#define OTABSL_NAMESPACE_END
124-
#elif OTABSL_OPTION_USE_INLINE_NAMESPACE == 1
125-
#define OTABSL_NAMESPACE_BEGIN \
126-
inline namespace OTABSL_OPTION_INLINE_NAMESPACE_NAME {
120+
121+
#define OTABSL_NAMESPACE_BEGIN namespace OTABSL_OPTION_NAMESPACE_NAME {
127122
#define OTABSL_NAMESPACE_END }
128-
#else
129-
#error options.h is misconfigured.
130-
#endif
131123

132124
// -----------------------------------------------------------------------------
133125
// Compiler Feature Checks
@@ -217,7 +209,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
217209

218210
// OTABSL_HAVE_SOURCE_LOCATION_CURRENT
219211
//
220-
// Indicates whether `absl::SourceLocation::current()` will return useful
212+
// Indicates whether `absl::OTABSL_OPTION_NAMESPACE_NAME::SourceLocation::current()` will return useful
221213
// information in some contexts.
222214
#ifndef OTABSL_HAVE_SOURCE_LOCATION_CURRENT
223215
#if OTABSL_INTERNAL_HAS_KEYWORD(__builtin_LINE) && \
@@ -570,7 +562,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
570562

571563
// OTABSL_USES_STD_ANY
572564
//
573-
// Indicates whether absl::any is an alias for std::any.
565+
// Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME::any is an alias for std::any.
574566
#if !defined(OTABSL_OPTION_USE_STD_ANY)
575567
#error options.h is misconfigured.
576568
#elif OTABSL_OPTION_USE_STD_ANY == 0 || \
@@ -585,7 +577,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
585577

586578
// OTABSL_USES_STD_OPTIONAL
587579
//
588-
// Indicates whether absl::optional is an alias for std::optional.
580+
// Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME::optional is an alias for std::optional.
589581
#if !defined(OTABSL_OPTION_USE_STD_OPTIONAL)
590582
#error options.h is misconfigured.
591583
#elif OTABSL_OPTION_USE_STD_OPTIONAL == 0 || \
@@ -600,7 +592,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
600592

601593
// OTABSL_USES_STD_VARIANT
602594
//
603-
// Indicates whether absl::variant is an alias for std::variant.
595+
// Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME::variant is an alias for std::variant.
604596
#if !defined(OTABSL_OPTION_USE_STD_VARIANT)
605597
#error options.h is misconfigured.
606598
#elif OTABSL_OPTION_USE_STD_VARIANT == 0 || \
@@ -615,7 +607,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
615607

616608
// OTABSL_USES_STD_STRING_VIEW
617609
//
618-
// Indicates whether absl::string_view is an alias for std::string_view.
610+
// Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME::string_view is an alias for std::string_view.
619611
#if !defined(OTABSL_OPTION_USE_STD_STRING_VIEW)
620612
#error options.h is misconfigured.
621613
#elif OTABSL_OPTION_USE_STD_STRING_VIEW == 0 || \
@@ -650,15 +642,10 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
650642
// the proper count to skip past the CCTZ fork namespace names. (This number
651643
// is one larger when there is an inline namespace name to skip.)
652644
#if defined(_MSC_VER)
653-
#if OTABSL_OPTION_USE_INLINE_NAMESPACE == 0
654-
#define OTABSL_INTERNAL_MANGLED_NS "absl"
655-
#define OTABSL_INTERNAL_MANGLED_BACKREFERENCE "5"
656-
#else
657645
#define OTABSL_INTERNAL_MANGLED_NS \
658-
OTABSL_INTERNAL_TOKEN_STR(OTABSL_OPTION_INLINE_NAMESPACE_NAME) "@absl"
646+
OTABSL_INTERNAL_TOKEN_STR(OTABSL_OPTION_NAMESPACE_NAME) "@absl"
659647
#define OTABSL_INTERNAL_MANGLED_BACKREFERENCE "6"
660648
#endif
661-
#endif
662649

663650
#undef OTABSL_INTERNAL_HAS_KEYWORD
664651

0 commit comments

Comments
 (0)