Skip to content

Commit

Permalink
Merge branch 'main' into ks/bazel-enable-incompatible_disallow_empty_…
Browse files Browse the repository at this point in the history
…glob
  • Loading branch information
marcalff authored Nov 23, 2024
2 parents 15045c5 + 6a77bcd commit f0af970
Show file tree
Hide file tree
Showing 176 changed files with 16,480 additions and 1,159 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -876,9 +876,9 @@ jobs:
CXX: /usr/bin/g++-10
run: ./ci/do_ci.sh code.coverage
- name: upload report
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
file: /home/runner/build/coverage.info
files: /home/runner/build/coverage.info

markdown-lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -946,8 +946,8 @@ jobs:
CXX_STANDARD: '14'
run: |
./ci/do_ci.sh cmake.w3c.trace-context.build-server
cd $HOME/build/ext/test/w3c_tracecontext_test
./w3c_tracecontext_test &
cd $HOME/build/ext/test/w3c_tracecontext_http_test_server
./w3c_tracecontext_http_test_server &
- name: Checkout w3c/trace-context repo
uses: actions/checkout@v4
with:
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/clang-tidy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ jobs:
CC: clang
CXX: clang++
run: |
mkdir -p build && cd build
echo "Running cmake..."
cmake .. \
cmake -B build \
-DCMAKE_CXX_STANDARD=14 \
-DWITH_STL=CXX14 \
-DWITH_OTLP_HTTP=ON \
Expand All @@ -62,23 +61,21 @@ jobs:
-DBUILD_W3CTRACECONTEXT_TEST=ON \
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_CLANG_TIDY="clang-tidy"
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Run clang-tidy
run: |
cd build
make 2>&1 | tee -a clang-tidy.log || exit 1
cmake --build build --target opentelemetry_proto
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
- uses: actions/upload-artifact@v4
with:
name: Logs (clang-tidy)
path: ./build/clang-tidy.log
path: ./clang-tidy.log

- name: Count warnings
run: |
cd build
COUNT=$(grep -c "warning:" clang-tidy.log)
echo "clang-tidy reported ${COUNT} warning(s)"
# TODO: include WITH_OTLP_GRPC and WITH_ABSEIL flags.
# TODO: include WITH_OTLP_GRPC and WITH_ABSEIL flags.
62 changes: 62 additions & 0 deletions .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

name: cppcheck

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
cppcheck:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Set up dependencies
run: |
sudo apt update -y
sudo apt install -y cppcheck
- name: Run cppcheck
run: |
cppcheck --version | tee cppcheck.log
cppcheck \
--force \
--enable=warning,performance,portability \
--inline-suppr \
--suppress=unknownMacro:exporters/etw/include/opentelemetry/exporters/etw/TraceLoggingDynamic.h \
--language=c++ \
--std=c++14 \
-I api/include \
-I exporters/elasticsearch/include \
-I exporters/etw/include \
-I exporters/memory/include \
-I exporters/ostream/include \
-I exporters/otlp/include \
-I exporters/prometheus/include \
-I exporters/zipkin/include \
-I ext/include \
-I opentracing-shim/include \
-I sdk/include \
-i build \
-i test \
-i third_party \
-j $(nproc) \
. 2>&1 | tee --append cppcheck.log
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: Logs (cppcheck)
path: ./cppcheck.log

- name: Count warnings
run: |
set +e
COUNT=`grep -c -E "\[.+\]" cppcheck.log`
echo "cppcheck reported ${COUNT} warning(s)"
# TODO: uncomment to enforce failing the build
# if [ $COUNT -ne 0 ] ; then exit 1 ; fi
27 changes: 23 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,21 @@ Increment the:

## [Unreleased]

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

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

* Upgrade to prometheus 1.3.0
[#3122](https://github.com/open-telemetry/opentelemetry-cpp/pull/3122)

* [SEMANTIC CONVENTIONS] Migration to weaver
[#3105](https://github.com/open-telemetry/opentelemetry-cpp/pull/3105)

* [EXPORTER] Allow to share gRPC clients between OTLP exporters.
[#3041](https://github.com/open-telemetry/opentelemetry-cpp/pull/3041)

Important changes:

* [API] Jaeger Propagator should not be deprecated
Expand All @@ -32,8 +41,18 @@ Important changes:
as the Jaeger propagator can be used without the (now removed)
Jaeger exporter.

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

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

* [SEMANTIC CONVENTIONS] Migration to weaver
[#3105](https://github.com/open-telemetry/opentelemetry-cpp/pull/3105)

* `semantic_convention.h` header files are deprecated,
replaced by `semconv/xxx_attributes.h` header files,
for each `xxx` semantic attribute group.
* See file DEPRECATED.md for details.

## [1.17 2024-10-07]

Expand Down
17 changes: 9 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ else()
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(ARCH x86)
endif()
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc")
# AIX will report the processor as 'powerpc' even if building in 64-bit mode
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH ppc64)
else()
set(ARCH ppc32)
endif()
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES
"^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)")
set(ARCH arm64)
Expand Down Expand Up @@ -382,14 +389,8 @@ if(WITH_OTLP_GRPC
OR WITH_OTLP_HTTP
OR WITH_OTLP_FILE)
find_package(Protobuf)
if(Protobuf_VERSION AND Protobuf_VERSION VERSION_GREATER_EQUAL "3.22.0")
if(NOT WITH_ABSEIL)
message(
FATAL_ERROR
"Protobuf 3.22 or upper require abseil-cpp(Recommended version: 20230125 or upper)"
)
endif()
endif()
# Protobuf 3.22 or upper require abseil-cpp, we can find it in
# opentelemetry-cpp-config.cmake

if(WITH_OTLP_GRPC)
find_package(gRPC)
Expand Down
78 changes: 78 additions & 0 deletions DEPRECATED.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,81 @@ N/A
## [Documentation]

N/A

## Semantic conventions

### Header files "semantic_conventions.h"

#### Announcement (semantic_conventions.h)

Deprecation is announced as part of the migration to weaver:

* `Version:` release following opentelemetry-cpp 1.17.0
* `Date:` Nov 9, 2024
* `PR:` [PR 3105](https://github.com/open-telemetry/opentelemetry-cpp/pull/3105)

#### Motivation (semantic_conventions.h)

The header files for semantic conventions are generated automatically.
The tooling to generate these files is changing:

* before, the build-tool repository was used
* now, the weaver repository is used

Changes in tooling allows to generate code that is better organized,
with dedicated header files per group of semantic conventions,
instead of a single header file for everything.

#### Scope (semantic_conventions.h)

The following files:

* `api/include/opentelemetry/trace/semantic_conventions.h`
* `sdk/include/opentelemetry/sdk/resource/semantic_conventions.h`

are now deprecated.

They correspond to semantic conventions v1.27.0,
and will no longer be maintained up to date.

These files will be removed in the future.

#### Mitigation (semantic_conventions.h)

Two things have changed:

* the header file to use
* the symbol name to use.

Before, the semantic convention for `url.full` was:

* declared in file `semantic_conventions.h`
* declared as symbol `SemanticConventions::kUrlFull`

Now, the `url.full` convention, which is part or the `url` group, is:

* declared in file `semconv/url_attributes.h`
* declared as symbol `semconv::url::kUrlFull`

Application code that uses semantic conventions must be adjusted
accordingly.

In addition, semantic conventions that are not marked as stable
are generated in a different header file, placed under directory
`incubating`, to better separate stable and non stable code.

For example, file `semconv/incubating/url_attributes.h`
defines `semconv::url::kUrlDomain`,
which is not marked as stable in semconv v1.27.0

#### Planned removal (semantic_conventions.h)

The following files:

* `api/include/opentelemetry/trace/semantic_conventions.h`
* `sdk/include/opentelemetry/sdk/resource/semantic_conventions.h`

will be removed.

The removal date is planned for July 1, 2025.
This allows more than six months for applications to adjust.
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "github_nlohma
bazel_dep(name = "opentelemetry-proto", version = "1.3.2", 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.2.4", repo_name = "com_github_jupp0r_prometheus_cpp")
bazel_dep(name = "prometheus-cpp", version = "1.3.0", repo_name = "com_github_jupp0r_prometheus_cpp")
bazel_dep(name = "protobuf", version = "26.0", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
bazel_dep(name = "zlib", version = "1.3.1.bcr.1")
Expand Down
6 changes: 4 additions & 2 deletions api/include/opentelemetry/common/spin_lock_mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ class SpinLockMutex
# else
__builtin_ia32_pause();
# endif
#elif defined(__arm__)
__asm__ volatile("yield" ::: "memory");
#elif defined(__armel__) || defined(__ARMEL__)
asm volatile("nop" ::: "memory");
#elif defined(__arm__) || defined(__aarch64__) // arm big endian / arm64
__asm__ __volatile__("yield" ::: "memory");
#else
// TODO: Issue PAGE/YIELD on other architectures.
#endif
Expand Down
5 changes: 2 additions & 3 deletions api/include/opentelemetry/logs/event_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ class EventLogger
}
nostd::unique_ptr<LogRecord> log_record = delegate_logger->CreateLogRecord();

IgnoreTraitResult(
detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::template Set(
log_record.get(), std::forward<ArgumentType>(args))...);
IgnoreTraitResult(detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::Set(
log_record.get(), std::forward<ArgumentType>(args))...);

EmitEvent(event_name, std::move(log_record));
}
Expand Down
5 changes: 2 additions & 3 deletions api/include/opentelemetry/logs/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ class Logger
return;
}

IgnoreTraitResult(
detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::template Set(
log_record.get(), std::forward<ArgumentType>(args))...);
IgnoreTraitResult(detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::Set(
log_record.get(), std::forward<ArgumentType>(args))...);

EmitLogRecord(std::move(log_record));
}
Expand Down
4 changes: 2 additions & 2 deletions api/include/opentelemetry/logs/logger_type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ struct LogRecordSetterTrait
* = nullptr>
inline static LogRecord *Set(LogRecord *log_record, ArgumentType &&arg) noexcept
{
return LogRecordSetterTrait<common::KeyValueIterable>::template Set(
log_record, std::forward<ArgumentType>(arg));
return LogRecordSetterTrait<common::KeyValueIterable>::Set(log_record,
std::forward<ArgumentType>(arg));
}

template <class ArgumentType,
Expand Down
4 changes: 2 additions & 2 deletions api/include/opentelemetry/nostd/internal/absl/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Notes on Abseil Variant implementation

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

0 comments on commit f0af970

Please sign in to comment.