diff --git a/.bazelrc b/.bazelrc
index fc170b0e8b..57cd0a2fa0 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -4,12 +4,12 @@
# bazel configurations for running tests under sanitizers.
# Based on https://github.com/bazelment/trunk/blob/master/tools/bazel.rc
-# TODO: Remove once support is added, avoid MODULE.bazel creation for now
-common --enable_bzlmod=false
-
# Enable automatic configs based on platform
common --enable_platform_specific_config
+# Make globs that don't match anything fail
+common --incompatible_disallow_empty_glob
+
# Needed by gRPC to build on some platforms.
build --copt -DGRPC_BAZEL_BUILD
diff --git a/.clang-format b/.clang-format
index 2640295e65..1b5d0d488f 100644
--- a/.clang-format
+++ b/.clang-format
@@ -59,3 +59,15 @@ IndentPPDirectives: AfterHash
# Include blocks style
IncludeBlocks: Preserve
+
+AttributeMacros:
+ - OPENTELEMETRY_UNLIKELY
+ - OPENTELEMETRY_LIKELY
+ - OPENTELEMETRY_MAYBE_UNUSED
+ - OPENTELEMETRY_DEPRECATED
+ - OPENTELEMETRY_API_SINGLETON
+ - OPENTELEMETRY_LOCAL_SYMBOL
+ - OPENTELEMETRY_EXPORT
+ - OPENTELEMETRY_SANITIZER_NO_MEMORY
+ - OPENTELEMETRY_SANITIZER_NO_THREAD
+ - OPENTELEMETRY_SANITIZER_NO_ADDRESS
\ No newline at end of file
diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 0000000000..db61b810c9
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,42 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+Checks: >
+ -*,
+ performance-*,
+ portability-*,
+ abseil-*,
+ -abseil-string-find-str-contains,
+ bugprone-*,
+ -bugprone-easily-swappable-parameters,
+ -bugprone-implicit-widening-of-multiplication-result,
+ -bugprone-inc-dec-in-conditions,
+ -bugprone-narrowing-conversions,
+ -bugprone-unchecked-optional-access,
+ -bugprone-unhandled-exception-at-new,
+ -bugprone-unused-local-non-trivial-variable,
+ google-*,
+ -google-build-using-namespace,
+ -google-default-arguments,
+ -google-explicit-constructor,
+ -google-readability-avoid-underscore-in-googletest-name,
+ -google-readability-braces-around-statements,
+ -google-readability-namespace-comments,
+ -google-readability-todo,
+ -google-runtime-references,
+ misc-*,
+ -misc-const-correctness,
+ -misc-include-cleaner,
+ -misc-non-private-member-variables-in-classes,
+ -misc-unused-alias-decls,
+ -misc-use-anonymous-namespace,
+ cppcoreguidelines-*,
+ -cppcoreguidelines-owning-memory,
+ -cppcoreguidelines-avoid-do-while,
+ -cppcoreguidelines-avoid-c-arrays,
+ -cppcoreguidelines-avoid-magic-numbers,
+ -cppcoreguidelines-init-variables,
+ -cppcoreguidelines-macro-usage,
+ -cppcoreguidelines-non-private-member-variables-in-classes,
+ -cppcoreguidelines-avoid-non-const-global-variables,
+ -cppcoreguidelines-pro-*
\ No newline at end of file
diff --git a/.devcontainer/Dockerfile.conan b/.devcontainer/Dockerfile.conan
new file mode 100644
index 0000000000..05f6ae27fa
--- /dev/null
+++ b/.devcontainer/Dockerfile.conan
@@ -0,0 +1,55 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+FROM ubuntu:24.04@sha256:1e622c5f073b4f6bfad6632f2616c7f59ef256e96fe78bf6a595d1dc4376ac02
+
+RUN apt update && apt install -y \
+ build-essential \
+ ca-certificates \
+ wget \
+ cmake \
+ git \
+ sudo \
+ nano \
+ pkg-config \
+ ninja-build \
+ clang-format \
+ clang-tidy \
+ autoconf \
+ automake \
+ libtool \
+ python3-pip
+
+RUN pip install "conan==2.15.1" --break-system-packages
+
+ARG USER_UID=1000
+ARG USER_GID=1000
+ARG USER_NAME=devuser
+ENV USER_NAME=devuser
+ENV USER_UID=${USER_UID}
+ENV USER_GID=${USER_GID}
+ENV INSTALL_PACKAGES=
+ENV IS_CONTAINER_BUILD=true
+
+COPY ./.devcontainer/customize_container.sh /tmp/opentelemetry_cpp/devcontainer/customize_container.sh
+RUN /tmp/opentelemetry_cpp/devcontainer/customize_container.sh
+USER devuser
+
+RUN conan profile detect --force
+
+ARG CONAN_FILE=conanfile_stable.txt
+ARG CONAN_BUILD_TYPE=Debug
+ARG CXX_STANDARD=17
+WORKDIR /home/devuser/conan
+COPY ./install/conan/ .
+
+RUN conan install ./${CONAN_FILE} --build=missing -s build_type=${CONAN_BUILD_TYPE}
+ENV CMAKE_TOOLCHAIN_FILE=/home/devuser/conan/build/${CONAN_BUILD_TYPE}/generators/conan_toolchain.cmake
+ENV CXX_STANDARD=${CXX_STANDARD}
+ENV BUILD_TYPE=${CONAN_BUILD_TYPE}
+ENV CONAN_FILE=${CONAN_FILE}
+
+WORKDIR /workspaces/opentelemetry-cpp
+
+ENTRYPOINT []
+
+CMD ["/bin/bash"]
diff --git a/.devcontainer/Dockerfile.dev b/.devcontainer/Dockerfile.dev
new file mode 100644
index 0000000000..60efed9723
--- /dev/null
+++ b/.devcontainer/Dockerfile.dev
@@ -0,0 +1,52 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+FROM otel/cpp_format_tools
+
+ARG USER_UID=1000
+ARG USER_GID=1000
+ARG INSTALL_PACKAGES=
+
+ARG CXX_STANDARD=17
+
+ENV CXX_STANDARD=${CXX_STANDARD}
+
+COPY ci /opt/ci
+
+RUN apt update && apt install -y wget \
+ ninja-build \
+ llvm-dev \
+ libclang-dev \
+ clang-tidy \
+ shellcheck \
+ sudo \
+ cmake
+
+RUN cd /opt/ci && bash setup_ci_environment.sh
+RUN cd /opt/ci && bash install_iwyu.sh
+
+ADD https://github.com/bazelbuild/bazelisk/releases/download/v1.22.1/bazelisk-linux-amd64 /usr/local/bin
+
+RUN git config --global core.autocrlf input \
+ && chmod +x /usr/local/bin/bazelisk-linux-amd64
+
+ENV INSTALL_PACKAGES=${INSTALL_PACKAGES}
+ENV USER_NAME=devuser
+ENV USER_UID=${USER_UID}
+ENV USER_GID=${USER_GID}
+ENV IS_CONTAINER_BUILD=true
+
+COPY install /opt/install
+COPY ./.devcontainer/customize_container.sh /tmp/opentelemetry_cpp/devcontainer/customize_container.sh
+RUN /tmp/opentelemetry_cpp/devcontainer/customize_container.sh
+RUN apt install -y npm && npm install -g markdownlint-cli@0.44.0
+
+USER devuser
+
+WORKDIR /workspaces/opentelemetry-cpp
+RUN cd /opt && bash ci/install_thirdparty.sh --install-dir /home/devuser/third-party/install-stable --tags-file install/cmake/third_party_stable
+ENV CMAKE_PREFIX_PATH=/home/devuser/third-party/install-stable
+
+ENTRYPOINT []
+
+CMD ["/bin/bash"]
diff --git a/.devcontainer/README.md b/.devcontainer/README.md
new file mode 100644
index 0000000000..c1cb3e1c92
--- /dev/null
+++ b/.devcontainer/README.md
@@ -0,0 +1,38 @@
+# Customizing Your Dev Container
+
+Customize your dev container using build arguments (for direct Docker builds) or
+environment variables (for evaluation in `devcontainer.json`).
+
+* **CXX standard:**
+ This is the C++ standard to build from (eg: 17, 20, ...). (Default: 17)
+ * Docker ARG:
+ `CXX_STANDARD`
+ * Host Environment Variable:
+ `OTEL_CPP_DEVCONTAINER_CXX_STANDARD`
+
+* **User ID (UID):**
+ User ID (Default: `1000`)
+ * Docker ARG:
+ `USER_UID`
+ * Host Environment Variable:
+ `OTEL_CPP_DEVCONTAINER_USER_UID`
+
+* **Group ID (GID):**
+ User group ID (Default: `1000`)
+ * Docker ARG:
+ `USER_GID`
+ * Host Environment Variable:
+ `OTEL_CPP_DEVCONTAINER_USER_GID`
+
+* **Install Packages:**
+ These are the additional packages that will be installed via `apt install` in the devcontainer. This is a space separated list.
+ * Docker ARG:
+ `INSTALL_PACKAGES` (Default: ``)
+ * Host Environment Variable:
+ `OTEL_CPP_DEVCONTAINER_INSTALL_PACKAGES` (Default: ``)
+
+## Examples
+
+* `docker build --build-arg CXX_STANDARD="20" --build-arg INSTALL_PACKAGES="nano gitk"...`
+* `export OTEL_CPP_DEVCONTAINER_CXX_STANDARD=20`
+* `export OTEL_CPP_DEVCONTAINER_INSTALL_PACKAGES="nano gitk"`
diff --git a/.devcontainer/customize_container.sh b/.devcontainer/customize_container.sh
new file mode 100755
index 0000000000..ba9614e671
--- /dev/null
+++ b/.devcontainer/customize_container.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+set -eu
+
+if [[ $IS_CONTAINER_BUILD != "true" ]]; then
+ echo "This script should only run inside a Docker container."
+ exit 1
+fi
+
+if [[ -n "$INSTALL_PACKAGES" ]]; then
+ packages=($INSTALL_PACKAGES)
+ for package in "${packages[@]}"; do
+ apt install -y "$package"
+ done
+fi
+
+if [[ $(id "$USER_NAME" 2>/dev/null) ]]; then
+ echo "User '$USER_NAME' already exists. Removing it."
+ userdel -rf "$USER_NAME"
+elif [[ $(id -u "$USER_UID" 2>/dev/null) ]]; then
+ OTHER_USER=$(getent passwd "$USER_UID" | cut -d: -f1)
+ echo "User '$OTHER_USER' exists with UID $USER_UID. Removing it."
+ userdel -rf "$OTHER_USER"
+fi
+
+if [[ ! $(getent group "$USER_GID" 2>/dev/null) ]]; then
+ echo "Group '$USER_GID' does not exist. Adding it."
+ groupadd -g "$USER_GID" "$USER_NAME"
+fi
+
+useradd -m -u "$USER_UID" -g "$USER_GID" -s /bin/bash "$USER_NAME"
+echo "Created user '$USER_NAME' (UID: $USER_UID, GID: $USER_GID)."
+
+echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" | tee /etc/sudoers.d/"$USER_NAME"
+
+echo "User and group setup complete."
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 0000000000..954c1eaf7e
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,31 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
+// https://github.com/microsoft/vscode-dev-containers/tree/v0.162.0/containers/javascript-node
+{
+ "name": "opentelemetry-cpp",
+ "build": {
+ "context": "..",
+ "dockerfile": "Dockerfile.dev",
+ "args": {
+ "USER_UID": "${localEnv:OTEL_CPP_DEVCONTAINER_USER_UID:1000}",
+ "USER_GID": "${localEnv:OTEL_CPP_DEVCONTAINER_USER_GID:1000}",
+ "INSTALL_PACKAGES": "${localEnv:OTEL_CPP_DEVCONTAINER_INSTALL_PACKAGES:}",
+ "CXX_STANDARD": "${localEnv:OTEL_CPP_DEVCONTAINER_CXX_STANDARD:17}"
+ }
+ },
+ "customizations": {
+ "vscode": {
+ "extensions": [
+ "ms-vscode.cpptools",
+ "ms-azuretools.vscode-docker",
+ "ms-vscode.cpptools-extension-pack"
+ ],
+ "settings": {
+ "terminal.integrated.shell.linux": "/bin/bash",
+ }
+ }
+ },
+
+ "remoteUser": "devuser"
+}
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index e0bb4cca27..7f45b9f5b0 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -17,3 +17,5 @@ What did you see instead?
**Additional context**
Add any other context about the problem here.
+
+**Tip**: [React](https://github.blog/news-insights/product-news/add-reactions-to-pull-requests-issues-and-comments/) with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it. Learn more [here](https://opentelemetry.io/community/end-user/issue-participation/).
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index 973549ab2d..95ec00965b 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -17,3 +17,5 @@ Which alternative solutions or features have you considered?
**Additional context**
Add any other context about the feature request here.
+
+**Tip**: [React](https://github.blog/news-insights/product-news/add-reactions-to-pull-requests-issues-and-comments/) with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it. Learn more [here](https://opentelemetry.io/community/end-user/issue-participation/).
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index d907392962..5cfb4cb898 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -6,3 +6,8 @@ updates:
interval: "daily"
labels:
- "GHA"
+
+ - package-ecosystem: "devcontainers"
+ directory: "/"
+ schedule:
+ interval: daily
diff --git a/.github/repository-settings.md b/.github/repository-settings.md
deleted file mode 100644
index fa86d02cfc..0000000000
--- a/.github/repository-settings.md
+++ /dev/null
@@ -1,38 +0,0 @@
-# Process
-
-This file documents local admin changes for opentelemetry-cpp,
-per the community process: https://github.com/open-telemetry/community/blob/main/docs/how-to-configure-new-repository.md
-
-Please note that the EasyCLA check **MUST** stay **REQUIRED**,
-it should never be disabled or bypassed, at the risk of tainting the repository.
-
-# Guidelines
-
-The best is to open a PR first that describes the change,
-so it can be discussed during review (maybe it is not needed,
-maybe there is an alternate solution, ...).
-
-The PR must add a log entry in this file, detailing:
-
-* the date the change is implemented
-* what is changed exactly (which setting)
-* a short rationale
-
-Admin changes are then applied only when the PR is merged.
-
-If for some reason a change is implemented in emergency,
-before a PR can be discussed and merged,
-a PR should still be prepared and pushed after the fact to
-describe the settings changed.
-
-# Log of local changes
-
-## 2023-11-03
-
-Created log file `.github/repository-settings.md`, since admin permissions are now granted to maintainers.
-
-See https://github.com/open-telemetry/community/issues/1727
-
-No setting changed.
-
-
diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml
index 6d8ed403d4..5dba836379 100644
--- a/.github/workflows/benchmark.yml
+++ b/.github/workflows/benchmark.yml
@@ -5,19 +5,23 @@ on:
- main
permissions:
- contents: write
- deployments: write
+ contents: read
jobs:
benchmark:
name: Run OpenTelemetry-cpp benchmarks
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@v4
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -35,20 +39,28 @@ jobs:
mv api-benchmark_result.json benchmarks
mv sdk-benchmark_result.json benchmarks
mv exporters-benchmark_result.json benchmarks
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47 # main March 2025
with:
name: benchmark_results
path: benchmarks
store_benchmark:
needs: benchmark
+ permissions:
+ contents: write
+ deployments: write
strategy:
matrix:
components: ["api", "sdk", "exporters"]
name: Store benchmark result
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
- - uses: actions/download-artifact@master
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # main March 2025
with:
name: benchmark_results
path: benchmarks
@@ -57,7 +69,7 @@ jobs:
run: |
cat benchmarks/*
- name: Push benchmark result
- uses: benchmark-action/github-action-benchmark@v1
+ uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 # v1.20.4
with:
name: OpenTelemetry-cpp ${{ matrix.components }} Benchmark
tool: 'googlecpp'
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8c17bbece0..d86bc53410 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -6,80 +6,102 @@ on:
pull_request:
branches: [ main ]
+permissions:
+ contents: read
+
jobs:
- arm64_test:
- name: CMake test arm64 (with modern protobuf,grpc and abseil)
- runs-on: actuated-arm64-4cpu-16gb
+
+# Commented 2024-11-06, lack of workers in github causes CI failures
+# arm64_test:
+# name: CMake test arm64 (with modern protobuf,grpc and abseil)
+# runs-on: actuated-arm64-4cpu-16gb
+# steps:
+# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+# with:
+# submodules: 'recursive'
+# - name: setup
+# env:
+# CXX_STANDARD: '14'
+# CC: /usr/bin/gcc-10
+# CXX: /usr/bin/g++-10
+# run: |
+# sudo -E ./ci/setup_gcc10.sh
+# sudo -E ./ci/setup_ci_environment.sh
+# - name: install dependencies
+# run: |
+# sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
+
+ cmake_test:
+ name: CMake test (prometheus, elasticsearch, zipkin)
+ runs-on: ubuntu-22.04
+ env:
+ CXX_STANDARD: '17'
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
- env:
- PROTOBUF_VERSION: '23.3'
- ABSEIL_CPP_VERSION: '20230125.3'
- CXX_STANDARD: '14'
- CC: /usr/bin/gcc-10
- CXX: /usr/bin/g++-10
run: |
- sudo -E ./ci/setup_gcc10.sh
- sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
- sudo -E ./ci/setup_googletest.sh
- sudo -E ./ci/install_abseil.sh
- sudo -E ./ci/install_protobuf.sh
- - name: run otlp exporter tests
- env:
- CC: /usr/bin/gcc-10
- CXX: /usr/bin/g++-10
- WITH_ABSEIL: 'ON'
- CXX_STANDARD: '14'
+ sudo -E apt-get install -y zlib1g-dev libcurl4-openssl-dev nlohmann-json3-dev
+ - name: run cmake tests
run: |
- sudo -E ./ci/setup_grpc.sh -m -p protobuf -p abseil-cpp
- ./ci/do_ci.sh cmake.exporter.otprotocol.test
+ ./ci/do_ci.sh cmake.test
- cmake_test:
- name: CMake test (without otlp-exporter)
- runs-on: ubuntu-latest
+ cmake_fetch_content_test:
+ name: CMake FetchContent usage with opentelemetry-cpp
+ runs-on: ubuntu-24.04
+ env:
+ CXX_STANDARD: '17'
+ CMAKE_VERSION: '3.14.0'
+ BUILD_TYPE: 'Debug'
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
- env:
- CC: /usr/bin/gcc-10
- CXX: /usr/bin/g++-10
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
+ sudo -E ./ci/setup_cmake.sh
+ - name: install dependencies
run: |
- ./ci/do_ci.sh cmake.test
+ sudo -E apt-get update
+ sudo -E apt-get install -y zlib1g-dev
+ - name: run fetch content cmake test
+ run: |
+ ./ci/do_ci.sh cmake.fetch_content.test
cmake_gcc_maintainer_sync_test:
name: CMake gcc 14 (maintainer mode, sync)
runs-on: ubuntu-24.04
+ env:
+ CC: /usr/bin/gcc-14
+ CXX: /usr/bin/g++-14
+ CXX_STANDARD: '14'
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
- env:
- CC: /usr/bin/gcc-14
- CXX: /usr/bin/g++-14
- PROTOBUF_VERSION: 21.12
run: |
- sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
- sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- sudo -E ./ci/install_protobuf.sh
+ - name: install dependencies
+ run: |
+ sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
- name: run cmake gcc (maintainer mode, sync)
- env:
- CC: /usr/bin/gcc-14
- CXX: /usr/bin/g++-14
run: |
./ci/do_ci.sh cmake.maintainer.sync.test
- name: generate test cert
@@ -95,24 +117,25 @@ jobs:
cmake_gcc_maintainer_async_test:
name: CMake gcc 14 (maintainer mode, async)
runs-on: ubuntu-24.04
+ env:
+ CC: /usr/bin/gcc-14
+ CXX: /usr/bin/g++-14
+ CXX_STANDARD: '14'
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
- env:
- CC: /usr/bin/gcc-14
- CXX: /usr/bin/g++-14
- PROTOBUF_VERSION: 21.12
run: |
- sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
- sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- sudo -E ./ci/install_protobuf.sh
+ - name: install dependencies
+ run: |
+ sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
- name: run cmake gcc (maintainer mode, async)
- env:
- CC: /usr/bin/gcc-14
- CXX: /usr/bin/g++-14
run: |
./ci/do_ci.sh cmake.maintainer.async.test
- name: generate test cert
@@ -128,24 +151,25 @@ jobs:
cmake_clang_maintainer_sync_test:
name: CMake clang 18 (maintainer mode, sync)
runs-on: ubuntu-24.04
+ env:
+ CC: /usr/bin/clang-18
+ CXX: /usr/bin/clang++-18
+ CXX_STANDARD: '14'
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
- env:
- CC: /usr/bin/clang-18
- CXX: /usr/bin/clang++-18
- PROTOBUF_VERSION: 21.12
run: |
- sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
- sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- sudo -E ./ci/install_protobuf.sh
+ - name: install dependencies
+ run: |
+ sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
- name: run cmake clang (maintainer mode, sync)
- env:
- CC: /usr/bin/clang-18
- CXX: /usr/bin/clang++-18
run: |
./ci/do_ci.sh cmake.maintainer.sync.test
- name: generate test cert
@@ -161,24 +185,25 @@ jobs:
cmake_clang_maintainer_async_test:
name: CMake clang 18 (maintainer mode, async)
runs-on: ubuntu-24.04
+ env:
+ CC: /usr/bin/clang-18
+ CXX: /usr/bin/clang++-18
+ CXX_STANDARD: '14'
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
- env:
- CC: /usr/bin/clang-18
- CXX: /usr/bin/clang++-18
- PROTOBUF_VERSION: 21.12
run: |
- sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
- sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- sudo -E ./ci/install_protobuf.sh
+ - name: install dependencies
+ run: |
+ sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
- name: run cmake clang (maintainer mode, async)
- env:
- CC: /usr/bin/clang-18
- CXX: /usr/bin/clang++-18
run: |
./ci/do_ci.sh cmake.maintainer.async.test
- name: generate test cert
@@ -194,24 +219,25 @@ jobs:
cmake_clang_maintainer_abiv2_test:
name: CMake clang 18 (maintainer mode, abiv2)
runs-on: ubuntu-24.04
+ env:
+ CC: /usr/bin/clang-18
+ CXX: /usr/bin/clang++-18
+ CXX_STANDARD: '14'
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
- env:
- CC: /usr/bin/clang-18
- CXX: /usr/bin/clang++-18
- PROTOBUF_VERSION: 21.12
run: |
- sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
- sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- sudo -E ./ci/install_protobuf.sh
+ - name: install dependencies
+ run: |
+ sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
- name: run cmake clang (maintainer mode, abiv2)
- env:
- CC: /usr/bin/clang-18
- CXX: /usr/bin/clang++-18
run: |
./ci/do_ci.sh cmake.maintainer.abiv2.test
- name: generate test cert
@@ -228,7 +254,12 @@ jobs:
name: CMake msvc (maintainer mode)
runs-on: windows-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
@@ -241,7 +272,12 @@ jobs:
name: CMake msvc (maintainer mode) with C++20
runs-on: windows-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
@@ -252,68 +288,85 @@ jobs:
CXX_STANDARD: '20'
run: ./ci/do_ci.ps1 cmake.maintainer.cxx20.stl.test
- cmake_with_async_export_test:
- name: CMake test (without otlp-exporter and with async export)
- runs-on: ubuntu-latest
+ cmake_msvc_maintainer_abiv2_test:
+ name: CMake msvc (maintainer mode, abiv2)
+ runs-on: windows-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
- env:
- CC: /usr/bin/gcc-10
- CXX: /usr/bin/g++-10
run: |
- sudo -E ./ci/setup_googletest.sh
- sudo -E ./ci/setup_ci_environment.sh
- - name: run cmake tests (without otlp-exporter)
+ ./ci/setup_windows_ci_environment.ps1
+ - name: run tests
env:
- CC: /usr/bin/gcc-10
- CXX: /usr/bin/g++-10
- run: |
- ./ci/do_ci.sh cmake.with_async_export.test
+ CXX_STANDARD: '20'
+ run: ./ci/do_ci.ps1 cmake.maintainer.abiv2.test
- cmake_abseil_stl_test:
- name: CMake test (with abseil)
- runs-on: ubuntu-20.04
+ cmake_with_async_export_test:
+ name: CMake test (without otlp-exporter and with async export)
+ runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
+ env:
+ 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 (enable abseil-cpp)
+ sudo -E apt-get install -y zlib1g-dev libcurl4-openssl-dev
+ - name: run cmake tests (without otlp-exporter)
+ env:
+ CC: /usr/bin/gcc-12
+ CXX: /usr/bin/g++-12
run: |
- sudo ./ci/install_abseil.sh
- ./ci/do_ci.sh cmake.abseil.test
+ ./ci/do_ci.sh cmake.with_async_export.test
cmake_opentracing_shim_test:
name: CMake test (with opentracing-shim)
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
run: |
- sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake tests (enable opentracing-shim)
run: ./ci/do_ci.sh cmake.opentracing_shim.test
cmake_test_cxx14_gcc:
name: CMake C++14 test(GCC)
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_ci_environment.sh
- sudo -E ./ci/setup_googletest.sh
- name: run tests (enable stl)
env:
CXX_STANDARD: '14'
@@ -321,15 +374,19 @@ jobs:
cmake_test_cxx17_gcc:
name: CMake C++17 test(GCC)
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_ci_environment.sh
- sudo -E ./ci/setup_googletest.sh
- name: run tests (enable stl)
env:
CXX_STANDARD: '17'
@@ -337,15 +394,19 @@ jobs:
cmake_test_cxx20_gcc:
name: CMake C++20 test(GCC)
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_ci_environment.sh
- sudo -E ./ci/setup_googletest.sh
- name: run tests
env:
CXX_STANDARD: '20'
@@ -357,9 +418,14 @@ 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
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
@@ -369,7 +435,6 @@ jobs:
CXXFLAGS: "-stdlib=libc++"
run: |
sudo -E ./ci/setup_ci_environment.sh
- sudo -E ./ci/setup_googletest.sh
- name: run tests
env:
CC: /usr/bin/clang
@@ -389,13 +454,17 @@ jobs:
name: CMake C++23 test(GCC)
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_ci_environment.sh
- sudo -E ./ci/setup_googletest.sh
- name: run tests
env:
CXX_STANDARD: '23'
@@ -407,9 +476,14 @@ 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
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
@@ -419,7 +493,6 @@ jobs:
CXXFLAGS: "-stdlib=libc++"
run: |
sudo -E ./ci/setup_ci_environment.sh
- sudo -E ./ci/setup_googletest.sh
- name: run tests
env:
CC: /usr/bin/clang
@@ -437,125 +510,140 @@ jobs:
cmake_otprotocol_test:
name: CMake test (with otlp-exporter)
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
run: |
- sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
+ - name: install dependencies
+ run: |
+ sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
- name: run otlp exporter tests
run: |
- sudo ./ci/setup_grpc.sh
./ci/do_ci.sh cmake.exporter.otprotocol.test
+ - name: generate test cert
+ env:
+ CFSSL_VERSION: 1.6.3
+ run: |
+ sudo -E ./tools/setup-cfssl.sh
+ (cd ./functional/cert; ./generate_cert.sh)
+ - name: run func test
+ run: |
+ (cd ./functional/otlp; ./run_test.sh)
cmake_modern_protobuf_grpc_with_abseil_test:
name: CMake test (with modern protobuf,grpc and abseil)
runs-on: ubuntu-latest
+ env:
+ CXX_STANDARD: '14'
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
- env:
- PROTOBUF_VERSION: '23.3'
- ABSEIL_CPP_VERSION: '20230125.3'
- CXX_STANDARD: '14'
run: |
- sudo ./ci/setup_googletest.sh
- sudo ./ci/setup_ci_environment.sh
- sudo -E ./ci/install_abseil.sh
- sudo -E ./ci/install_protobuf.sh
+ sudo -E ./ci/setup_ci_environment.sh
+ - name: install dependencies
+ run: |
+ sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file install/cmake/third_party_stable
- name: run otlp exporter tests
- env:
- WITH_ABSEIL: 'ON'
- CXX_STANDARD: '14'
run: |
- sudo -E ./ci/setup_grpc.sh -m -p protobuf -p abseil-cpp
./ci/do_ci.sh cmake.exporter.otprotocol.test
cmake_do_not_install_test:
name: CMake do not install test (with otlp-exporter)
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
run: |
- sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
+ - name: install dependencies
+ run: |
+ sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
- name: run otlp exporter tests
run: |
- sudo ./ci/setup_grpc.sh
./ci/do_ci.sh cmake.do_not_install.test
cmake_otprotocol_shared_libs_with_static_grpc_test:
name: CMake test (build shared libraries with otlp-exporter and static gRPC)
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
- submodules: 'recursive'
- - name: setup
- run: |
- sudo -E ./ci/setup_googletest.sh
- sudo -E ./ci/setup_ci_environment.sh
- - name: run otlp exporter tests
- run: |
- sudo ./ci/setup_grpc.sh -T
- ./ci/do_ci.sh cmake.exporter.otprotocol.shared_libs.with_static_grpc.test
+ egress-policy: audit
- cmake_install_test:
- name: CMake install test (with abseil)
- runs-on: ubuntu-20.04
- steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
run: |
- sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- - name: run cmake install (with abseil)
+ - name: install dependencies
run: |
- sudo ./ci/install_abseil.sh
- ./ci/do_ci.sh cmake.install.test
- - name: verify packages
+ sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release
+ - name: run otlp exporter tests
run: |
- ./ci/verify_packages.sh
+ ./ci/do_ci.sh cmake.exporter.otprotocol.shared_libs.with_static_grpc.test
plugin_test:
name: Plugin -> CMake
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
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:
name: Bazel
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@v4
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -572,11 +660,16 @@ jobs:
name: Bazel without bzlmod
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@v4
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -593,11 +686,16 @@ jobs:
name: Bazel with async export
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@v4
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -614,11 +712,16 @@ jobs:
name: Bazel valgrind
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@v4
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -635,11 +738,16 @@ jobs:
name: Bazel noexcept
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@v4
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -656,11 +764,16 @@ jobs:
name: Bazel nortti
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@v4
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -677,11 +790,16 @@ jobs:
name: Bazel asan config
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@v4
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -698,11 +816,16 @@ jobs:
name: Bazel tsan config
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@v4
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -719,11 +842,16 @@ jobs:
name: Bazel on MacOS
runs-on: macos-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@v4
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -736,11 +864,16 @@ jobs:
name: Benchmark
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@v4
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -755,7 +888,7 @@ jobs:
env BENCHMARK_DIR=/benchmark
./ci/do_ci.sh benchmark
- name: Upload benchmark results
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: benchmark_reports
path: /home/runner/benchmark
@@ -764,25 +897,40 @@ jobs:
name: Format
runs-on: ubuntu-24.04
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: setup
- run: sudo apt remove needrestart && sudo ./ci/install_format_tools.sh #refer: https://github.com/actions/runner-images/issues/9937
+ run: sudo ./ci/install_format_tools.sh
- name: run tests
run: ./ci/do_ci.sh format
copyright:
name: Copyright
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: check copyright
run: ./tools/check_copyright.sh
windows:
name: CMake -> exporter proto
- runs-on: windows-2019
+ runs-on: windows-2022
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
@@ -796,9 +944,14 @@ jobs:
windows-build-dll:
name: CMake -> exporter proto (Build as DLL)
- runs-on: windows-2019
+ runs-on: windows-2022
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
@@ -814,9 +967,14 @@ jobs:
windows_with_async_export:
name: CMake (With async export) -> exporter proto
- runs-on: windows-2019
+ runs-on: windows-2022
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
@@ -830,9 +988,14 @@ jobs:
windows_bazel:
name: Bazel Windows
- runs-on: windows-2019
+ runs-on: windows-2022
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
@@ -843,9 +1006,14 @@ jobs:
windows_plugin_test:
name: Plugin -> CMake Windows
- runs-on: windows-2019
+ runs-on: windows-2022
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
@@ -856,9 +1024,14 @@ jobs:
code_coverage:
name: Code coverage
- runs-on: ubuntu-latest
+ runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
@@ -866,7 +1039,6 @@ jobs:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
- sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run tests and generate report
env:
@@ -874,19 +1046,24 @@ 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@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
- file: /home/runner/build/coverage.info
+ files: /home/runner/build/coverage.info
markdown-lint:
runs-on: ubuntu-latest
steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
- name: check out code
- uses: actions/checkout@v4
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: install markdownlint-cli
- run: sudo npm install -g markdownlint-cli
+ run: sudo npm install -g markdownlint-cli@0.44.0
- name: run markdownlint
run: markdownlint .
@@ -894,8 +1071,13 @@ jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
- name: check out code
- uses: actions/checkout@v4
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: install shellcheck
run: sudo apt install --assume-yes shellcheck
- name: run shellcheck
@@ -904,8 +1086,13 @@ jobs:
misspell:
runs-on: ubuntu-latest
steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
- name: check out code
- uses: actions/checkout@v4
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: install misspell
run: |
curl -L -o ./install-misspell.sh https://git.io/misspell
@@ -917,9 +1104,58 @@ jobs:
name: DocFX check
runs-on: windows-latest
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: install docfx
run: choco install docfx -y --version=2.58.5
- name: run ./ci/docfx.cmd
shell: cmd
run: ./ci/docfx.cmd
+
+ w3c_trace_context_compliance_v1:
+ name: W3C Distributed Tracing Validation V1
+ runs-on: ubuntu-latest
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - name: Checkout open-telemetry/opentelemetry-cpp
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ submodules: 'recursive'
+ - name: setup
+ env:
+ CC: /usr/bin/gcc-12
+ CXX: /usr/bin/g++-12
+ run: |
+ sudo -E ./ci/setup_ci_environment.sh
+ sudo -E apt-get install -y zlib1g-dev libcurl4-openssl-dev
+ - name: run w3c trace-context test server (background)
+ env:
+ CXX_STANDARD: '14'
+ run: |
+ ./ci/do_ci.sh cmake.w3c.trace-context.build-server
+ cd $HOME/build/ext/test/w3c_tracecontext_http_test_server
+ ./w3c_tracecontext_http_test_server &
+ - name: Checkout w3c/trace-context repo
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ repository: w3c/trace-context
+ path: trace-context
+ - name: install dependencies
+ run: |
+ sudo apt update && sudo apt install python3-pip
+ sudo pip3 install aiohttp==3.11.18
+ - name: run w3c trace-context test suite
+ env:
+ SPEC_LEVEL: 1
+ run:
+ |
+ python ${GITHUB_WORKSPACE}/trace-context/test/test.py http://localhost:30000/test TraceContextTest AdvancedTest
+ curl http://localhost:30000/stop
diff --git a/.github/workflows/clang-tidy.yaml b/.github/workflows/clang-tidy.yaml
new file mode 100644
index 0000000000..9d7abda33d
--- /dev/null
+++ b/.github/workflows/clang-tidy.yaml
@@ -0,0 +1,98 @@
+name: clang-tidy
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+
+permissions:
+ contents: read
+
+jobs:
+ clang-tidy:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - cmake_options: all-options-abiv1-preview
+ warning_limit: 61
+ - cmake_options: all-options-abiv2-preview
+ warning_limit: 61
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ submodules: recursive
+
+ - name: Setup Environment
+ run: |
+ sudo apt update -y
+ sudo apt install -y --no-install-recommends --no-install-suggests \
+ build-essential \
+ cmake \
+ zlib1g-dev \
+ libssl-dev \
+ libcurl4-openssl-dev \
+ nlohmann-json3-dev \
+ libabsl-dev \
+ libprotobuf-dev \
+ libgrpc++-dev \
+ protobuf-compiler \
+ protobuf-compiler-grpc \
+ libgmock-dev \
+ libgtest-dev \
+ libbenchmark-dev
+
+ if ! command -v clang-tidy &> /dev/null; then
+ echo "clang-tidy could not be found"
+ exit 1
+ fi
+ echo "Using clang-tidy version: $(clang-tidy --version)"
+ echo "clang-tidy installed at: $(which clang-tidy)"
+
+ - name: Prepare CMake
+ env:
+ CC: clang
+ CXX: clang++
+ run: |
+ echo "Running cmake..."
+ cmake -B build-${{ matrix.cmake_options }} \
+ -C ./test_common/cmake/${{ matrix.cmake_options }}.cmake \
+ -DCMAKE_CXX_STANDARD=14 \
+ -DWITH_STL=CXX14 \
+ -DWITH_OPENTRACING=OFF \
+ -DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
+ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
+ -DCMAKE_CXX_CLANG_TIDY="clang-tidy;--quiet;-p;build-${{ matrix.cmake_options }}"
+
+ - name: Run clang-tidy
+ run: |
+ cmake --build build-${{ matrix.cmake_options }} -- -j$(nproc) 2>&1 | tee clang-tidy-${{ matrix.cmake_options }}.log
+
+ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+ with:
+ name: Logs-clang-tidy-${{ matrix.cmake_options }}
+ path: ./clang-tidy-${{ matrix.cmake_options }}.log
+
+ - name: Count warnings
+ run: |
+ COUNT=$(grep -c "warning:" clang-tidy-${{ matrix.cmake_options }}.log)
+ echo "clang-tidy reported ${COUNT} warning(s) with cmake options preset '${{ matrix.cmake_options }}'"
+
+ readonly WARNING_LIMIT=${{ matrix.warning_limit }}
+
+ # FAIL the build if COUNT > WARNING_LIMIT
+ if [ $COUNT -gt $WARNING_LIMIT ] ; then
+ echo "clang-tidy reported ${COUNT} warning(s) exceeding the existing warning limit of ${WARNING_LIMIT} with cmake options preset '${{ matrix.cmake_options }}'"
+ exit 1
+ # WARN in annotations if COUNT > 0
+ elif [ $COUNT -gt 0 ] ; then
+ echo "::warning::clang-tidy reported ${COUNT} warning(s) with cmake options preset '${{ matrix.cmake_options }}'"
+ fi
+
diff --git a/.github/workflows/cmake_install.yml b/.github/workflows/cmake_install.yml
new file mode 100644
index 0000000000..8bee2b2161
--- /dev/null
+++ b/.github/workflows/cmake_install.yml
@@ -0,0 +1,318 @@
+name: CMake Install Tests
+
+on:
+ workflow_dispatch:
+ push:
+ branches: [ main ]
+ pull_request:
+ branches: [ main ]
+
+permissions:
+ contents: read
+
+jobs:
+ windows_2022_vcpkg_submodule:
+ name: Windows 2022 vcpkg submodule versions cxx17 (static libs - dll)
+ runs-on: windows-2022
+ env:
+ # cxx17 is the default for windows-2022
+ CXX_STANDARD: '17'
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ submodules: 'recursive'
+ - name: Build dependencies with vcpkg submodule
+ run: |
+ ./ci/setup_windows_ci_environment.ps1
+ - name: Run Tests
+ run: ./ci/do_ci.ps1 cmake.install.test
+ - name: Run DLL Tests
+ run: ./ci/do_ci.ps1 cmake.dll.install.test
+
+ windows_2025_vcpkg_submodule:
+ name: Windows 2025 vcpkg submodule versions cxx20 (static libs)
+ runs-on: windows-2025
+ env:
+ CXX_STANDARD: '20'
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ submodules: 'recursive'
+ - name: Build dependencies with vcpkg submodule
+ run: |
+ ./ci/setup_windows_ci_environment.ps1
+ - name: Run Tests
+ run: ./ci/do_ci.ps1 cmake.install.test
+
+ ubuntu_2404_system_packages:
+ name: Ubuntu 24.04 apt packages cxx17 (static libs - shared libs)
+ runs-on: ubuntu-24.04
+ env:
+ INSTALL_TEST_DIR: '/home/runner/install_test'
+ # cxx17 is the default for Ubuntu 24.04
+ CXX_STANDARD: '17'
+ BUILD_TYPE: 'Debug'
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ submodules: 'recursive'
+ - name: Setup CI Environment
+ run: |
+ sudo -E ./ci/setup_ci_environment.sh
+ - name: Install Dependencies
+ run: |
+ sudo -E apt-get update
+ sudo -E apt-get install -y libabsl-dev libcurl4-openssl-dev zlib1g-dev nlohmann-json3-dev libprotobuf-dev libgrpc++-dev protobuf-compiler protobuf-compiler-grpc
+ sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release --packages "googletest;benchmark"
+ - name: Run Tests (static libs)
+ env:
+ BUILD_SHARED_LIBS: 'OFF'
+ run: ./ci/do_ci.sh cmake.install.test
+ - name: Run Tests (shared libs)
+ env:
+ BUILD_SHARED_LIBS: 'ON'
+ run: ./ci/do_ci.sh cmake.install.test
+
+ ubuntu_2404_latest:
+ name: Ubuntu 24.04 latest versions cxx20 (static libs - shared libs)
+ runs-on: ubuntu-24.04
+ env:
+ INSTALL_TEST_DIR: '/home/runner/install_test'
+ CXX_STANDARD: '20'
+ BUILD_TYPE: 'Debug'
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ submodules: 'recursive'
+ - name: Setup CI Environment
+ run: |
+ sudo -E ./ci/setup_ci_environment.sh
+ - name: Install Dependencies
+ run: |
+ sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file install/cmake/third_party_latest
+ - name: Run Tests (static libs)
+ env:
+ BUILD_SHARED_LIBS: 'OFF'
+ run: ./ci/do_ci.sh cmake.install.test
+ - name: Run Tests (shared libs)
+ env:
+ BUILD_SHARED_LIBS: 'ON'
+ run: ./ci/do_ci.sh cmake.install.test
+
+ ubuntu_2204_stable:
+ name: Ubuntu 22.04 stable versions cxx17 (static libs - shared libs)
+ runs-on: ubuntu-22.04
+ env:
+ INSTALL_TEST_DIR: '/home/runner/install_test'
+ CXX_STANDARD: '17'
+ BUILD_TYPE: 'Debug'
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ submodules: 'recursive'
+ - name: Setup CI Environment
+ run: |
+ sudo -E ./ci/setup_ci_environment.sh
+ - name: Install Dependencies
+ run: |
+ sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file install/cmake/third_party_stable
+ - name: Run Tests (static libs)
+ env:
+ BUILD_SHARED_LIBS: 'OFF'
+ run: ./ci/do_ci.sh cmake.install.test
+ - name: Run Tests (shared libs)
+ env:
+ BUILD_SHARED_LIBS: 'ON'
+ run: ./ci/do_ci.sh cmake.install.test
+
+ ubuntu_2204_minimum:
+ name: Ubuntu 22.04 minimum versions cxx14 (static libs - shared libs)
+ runs-on: ubuntu-22.04
+ env:
+ INSTALL_TEST_DIR: '/home/runner/install_test'
+ # Set to the current minimum version of cmake
+ CMAKE_VERSION: '3.14.0'
+ # cxx14 is the default for Ubuntu 22.04
+ CXX_STANDARD: '14'
+ BUILD_TYPE: 'Debug'
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ submodules: 'recursive'
+ - name: Setup CI Environment
+ run: |
+ sudo -E ./ci/setup_ci_environment.sh
+ sudo -E ./ci/setup_cmake.sh
+ - name: Install Dependencies
+ run: |
+ sudo -E ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file install/cmake/third_party_minimum
+ - name: Run Tests (static libs)
+ env:
+ BUILD_SHARED_LIBS: 'OFF'
+ run: ./ci/do_ci.sh cmake.install.test
+ - name: Run Tests (shared libs)
+ env:
+ BUILD_SHARED_LIBS: 'ON'
+ run: ./ci/do_ci.sh cmake.install.test
+
+ ubuntu_2404_conan_stable:
+ name: Ubuntu 24.04 conan stable versions cxx17 (static libs - opentracing shim)
+ runs-on: ubuntu-24.04
+ env:
+ INSTALL_TEST_DIR: '/home/runner/install_test'
+ CXX_STANDARD: '17'
+ CMAKE_TOOLCHAIN_FILE: /home/runner/conan/build/Debug/generators/conan_toolchain.cmake
+ BUILD_TYPE: 'Debug'
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ submodules: 'recursive'
+ - name: Install Conan
+ run: |
+ python3 -m pip install pip==25.0.1
+ pip install "conan==2.15.1"
+ conan profile detect --force
+ - name: Install or build all dependencies with Conan
+ run: |
+ conan install install/conan/conanfile_stable.txt --build=missing -of /home/runner/conan -s build_type=${BUILD_TYPE} -s compiler.cppstd=${CXX_STANDARD}
+ conan cache clean --source --build
+ - name: Run Tests (static libs)
+ env:
+ BUILD_SHARED_LIBS: 'OFF'
+ run: ./ci/do_ci.sh cmake.install.test
+ - name: verify pkgconfig packages
+ run: |
+ export PKG_CONFIG_PATH=$INSTALL_TEST_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
+ ./ci/verify_packages.sh
+ - name: Run OpenTracing Shim Test
+ run: ./ci/do_ci.sh cmake.opentracing_shim.install.test
+
+ ubuntu_2404_conan_latest:
+ name: Ubuntu 24.04 conan latest versions cxx17 (static libs - opentracing shim)
+ runs-on: ubuntu-24.04
+ env:
+ INSTALL_TEST_DIR: '/home/runner/install_test'
+ CXX_STANDARD: '17'
+ CMAKE_TOOLCHAIN_FILE: /home/runner/conan/build/Debug/generators/conan_toolchain.cmake
+ BUILD_TYPE: 'Debug'
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ submodules: 'recursive'
+ - name: Install Conan
+ run: |
+ python3 -m pip install pip==25.0.1
+ pip install "conan==2.15.1"
+ conan profile detect --force
+ - name: Install or build all dependencies with Conan
+ run: |
+ conan install install/conan/conanfile_latest.txt --build=missing -of /home/runner/conan -s build_type=${BUILD_TYPE} -s compiler.cppstd=${CXX_STANDARD}
+ conan cache clean --source --build
+ - name: Run Tests (static libs)
+ env:
+ BUILD_SHARED_LIBS: 'OFF'
+ run: ./ci/do_ci.sh cmake.install.test
+ - name: verify pkgconfig packages
+ run: |
+ export PKG_CONFIG_PATH=$INSTALL_TEST_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
+ ./ci/verify_packages.sh
+ - name: Run OpenTracing Shim Test
+ run: ./ci/do_ci.sh cmake.opentracing_shim.install.test
+
+ macos_14_conan_stable:
+ name: macOS 14 conan stable versions cxx17 (static libs)
+ runs-on: macos-14
+ env:
+ INSTALL_TEST_DIR: '/Users/runner/install_test'
+ CXX_STANDARD: '17'
+ CMAKE_TOOLCHAIN_FILE: '/Users/runner/conan/build/Debug/generators/conan_toolchain.cmake'
+ BUILD_TYPE: 'Debug'
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ submodules: 'recursive'
+ - name: Install Conan and tools
+ run: |
+ brew install conan autoconf automake libtool coreutils
+ conan profile detect --force
+ - name: Install or build all dependencies with Conan
+ run: |
+ conan install install/conan/conanfile_stable.txt --build=missing -of /Users/runner/conan -s build_type=${BUILD_TYPE} -s compiler.cppstd=${CXX_STANDARD}
+ conan cache clean --source --build
+ - name: Run Tests (static libs)
+ env:
+ BUILD_SHARED_LIBS: 'OFF'
+ run: ./ci/do_ci.sh cmake.install.test
+
+ macos_14_brew_packages:
+ name: macOS 14 brew latest versions cxx17 (static libs)
+ runs-on: macos-14
+ env:
+ INSTALL_TEST_DIR: '/Users/runner/install_test'
+ CXX_STANDARD: '17'
+ BUILD_TYPE: 'Debug'
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ submodules: 'recursive'
+ - name: Install Dependencies with Homebrew
+ run: |
+ brew install coreutils
+ brew install googletest
+ brew install google-benchmark
+ brew install zlib
+ brew install abseil
+ brew install protobuf
+ brew install grpc
+ brew install nlohmann-json
+ brew install prometheus-cpp
+ - name: Run Tests (static libs)
+ env:
+ BUILD_SHARED_LIBS: 'OFF'
+ run: ./ci/do_ci.sh cmake.install.test
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 05acb56180..cd3adf143c 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -7,12 +7,24 @@ on:
# The branches below must be a subset of the branches above
branches: [main]
+permissions:
+ contents: read
+
jobs:
CodeQL-Build:
+ permissions:
+ actions: read # for github/codeql-action/init to get workflow details
+ contents: read # for actions/checkout to fetch code
+ security-events: write # for github/codeql-action/autobuild to send a status report
runs-on: ubuntu-latest
steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
- name: Checkout repository
- uses: actions/checkout@v4
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: Remove Third_party Modules from Code Scan
@@ -20,17 +32,15 @@ jobs:
rm -rf third_party
- name: Setup
env:
- CC: /usr/bin/gcc-10
- CXX: /usr/bin/g++-10
- GOOGLETEST_VERSION: 1.12.1
+ 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: Initialize CodeQL
- uses: github/codeql-action/init@v3
+ uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.8
with:
languages: cpp
- name: Autobuild
- uses: github/codeql-action/autobuild@v3
+ uses: github/codeql-action/autobuild@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.8
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v3
+ uses: github/codeql-action/analyze@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.8
diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml
new file mode 100644
index 0000000000..ec11d4e9c6
--- /dev/null
+++ b/.github/workflows/cppcheck.yml
@@ -0,0 +1,77 @@
+
+name: cppcheck
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+ branches: [ main ]
+
+permissions:
+ contents: read
+
+jobs:
+ cppcheck:
+ runs-on: ubuntu-24.04
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ 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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+ if: success() || failure()
+ with:
+ name: Logs (cppcheck)
+ path: ./cppcheck.log
+
+ - name: Count warnings
+ run: |
+ set +e
+ readonly WARNING_COUNT=`grep -c -E "\[.+\]" cppcheck.log`
+ echo "cppcheck reported ${WARNING_COUNT} warning(s)"
+ # Acceptable limit, to decrease over time down to 0
+ readonly WARNING_LIMIT=10
+ # FAIL the build if WARNING_COUNT > WARNING_LIMIT
+ if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then
+ exit 1
+ # WARN in annotations if WARNING_COUNT > 0
+ elif [ $WARNING_COUNT -gt 0 ] ; then
+ echo "::warning::cppcheck reported ${WARNING_COUNT} warning(s)"
+ fi
diff --git a/.github/workflows/dependencies_image.yml b/.github/workflows/dependencies_image.yml
index 0c7bad843f..6b518e441d 100644
--- a/.github/workflows/dependencies_image.yml
+++ b/.github/workflows/dependencies_image.yml
@@ -3,25 +3,33 @@ on:
schedule:
- cron: "0 3 * * 6"
+permissions:
+ contents: read
+
jobs:
docker_image:
name: Docker Image
runs-on: ubuntu-latest
timeout-minutes: 300
steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
-
name: checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
-
name: Set up QEMU
- uses: docker/setup-qemu-action@v3
+ uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
-
name: Set up Docker Buildx
id: buildx
- uses: docker/setup-buildx-action@v3
+ uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
-
name: Build Image
- uses: docker/build-push-action@v6
+ uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
builder: ${{ steps.buildx.outputs.name }}
context: ci/
@@ -39,7 +47,7 @@ jobs:
docker save -o /opt/otel-cpp-deps-debian.tar otel-cpp-deps
-
name: Upload Image
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: otel-cpp-deps
path: /opt/otel-cpp-deps-debian.tar
diff --git a/.github/workflows/fossa.yml b/.github/workflows/fossa.yml
new file mode 100644
index 0000000000..1a7ab4e426
--- /dev/null
+++ b/.github/workflows/fossa.yml
@@ -0,0 +1,25 @@
+name: FOSSA scanning
+
+on:
+ push:
+ branches:
+ - main
+
+permissions:
+ contents: read
+
+jobs:
+ fossa:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+
+ - uses: fossas/fossa-action@3ebcea1862c6ffbd5cf1b4d0bd6b3fe7bd6f2cac # v1.7.0
+ with:
+ api-key: ${{secrets.FOSSA_API_KEY}}
+ team: OpenTelemetry
diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml
index 29b8274fbd..76c9c93bc7 100644
--- a/.github/workflows/iwyu.yml
+++ b/.github/workflows/iwyu.yml
@@ -7,11 +7,30 @@ on:
pull_request:
branches: [ main ]
+permissions:
+ contents: read
+
jobs:
iwyu:
runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - cmake_options: all-options-abiv1
+ warning_limit: 0
+ - cmake_options: all-options-abiv1-preview
+ warning_limit: 0
+ - cmake_options: all-options-abiv2-preview
+ warning_limit: 0
+
steps:
- - uses: actions/checkout@v4
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
@@ -20,42 +39,60 @@ jobs:
sudo apt update -y
sudo apt install -y --no-install-recommends --no-install-suggests \
build-essential \
- iwyu \
- cmake \
ninja-build \
libssl-dev \
libcurl4-openssl-dev \
+ libabsl-dev \
libprotobuf-dev \
+ libgrpc++-dev \
protobuf-compiler \
+ protobuf-compiler-grpc \
libgmock-dev \
libgtest-dev \
- libbenchmark-dev
-
+ libbenchmark-dev \
+ llvm-dev \
+ libclang-dev \
+ cmake
+ - name: Install include-what-you-use
+ run: |
+ sudo ./ci/install_iwyu.sh
- name: Prepare CMake
+ env:
+ CC: clang
+ CXX: clang++
run: |
TOPDIR=`pwd`
- mkdir build && cd build
- CC="clang" CXX="clang++" cmake \
- -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;" \
- -DBUILD_TESTING=OFF \
- -DWITH_DEPRECATED_SDK_FACTORY=OFF \
- -DBUILD_W3CTRACECONTEXT_TEST=OFF \
- ..
+ cmake -B build-${{ matrix.cmake_options }} \
+ -C ./test_common/cmake/${{ matrix.cmake_options }}.cmake \
+ -DCMAKE_CXX_STANDARD=14 \
+ -DWITH_STL=CXX14 \
+ -DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
+ -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;"
- name: iwyu_tool
run: |
- cd build
- make -k 2>&1 | tee -a iwyu.log
+ cmake --build build-${{ matrix.cmake_options }} -- -j$(nproc) -k 2>&1 | tee -a iwyu-${{ matrix.cmake_options }}.log
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: success() || failure()
with:
- name: Logs (include-what-you-use)
- path: ./build/*.log
+ name: Logs-iwyu-${{ matrix.cmake_options }}
+ path: ./iwyu-${{ matrix.cmake_options }}.log
- name: count warnings
run: |
- cd build
- COUNT=`grep -c "Warning:" iwyu.log`
- echo "include-what-you-use reported ${COUNT} warning(s)"
-
+ set +e
+ echo "include-what-you-use version:"
+ include-what-you-use --version
+ readonly WARNING_COUNT=`grep -c "include-what-you-use reported diagnostics:" iwyu-${{ matrix.cmake_options }}.log`
+ echo "include-what-you-use reported ${WARNING_COUNT} warning(s) with cmake options preset '${{ matrix.cmake_options }}'"
+ # Acceptable limit, to decrease over time down to 0
+ readonly WARNING_LIMIT=${{ matrix.warning_limit }}
+ # FAIL the build if WARNING_COUNT > WARNING_LIMIT
+ if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then
+ echo "include-what-you-use reported ${WARNING_COUNT} warning(s) exceeding the existing warning limit of ${WARNING_LIMIT} with cmake options preset '${{ matrix.cmake_options }}'"
+ exit 1
+ # WARN in annotations if WARNING_COUNT > 0
+ elif [ $WARNING_COUNT -gt 0 ] ; then
+ echo "::warning::include-what-you-use reported ${WARNING_COUNT} warning(s) with cmake options preset '${{ matrix.cmake_options }}'"
+ fi
diff --git a/.github/workflows/ossf-scorecard.yml b/.github/workflows/ossf-scorecard.yml
new file mode 100644
index 0000000000..09f0ba7f0d
--- /dev/null
+++ b/.github/workflows/ossf-scorecard.yml
@@ -0,0 +1,52 @@
+name: OSSF Scorecard
+
+on:
+ push:
+ branches:
+ - main
+ schedule:
+ - cron: "56 23 * * 6" # once a week
+ workflow_dispatch:
+
+permissions: read-all
+
+jobs:
+ analysis:
+ runs-on: ubuntu-latest
+ permissions:
+ # Needed for Code scanning upload
+ security-events: write
+ # Needed for GitHub OIDC token if publish_results is true
+ id-token: write
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
+
+ - uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
+ with:
+ results_file: results.sarif
+ results_format: sarif
+ publish_results: true
+
+ # Upload the results as artifacts (optional). Commenting out will disable
+ # uploads of run results in SARIF format to the repository Actions tab.
+ # https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
+ - name: "Upload artifact"
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+ with:
+ name: SARIF file
+ path: results.sarif
+ retention-days: 5
+
+ # Upload the results to GitHub's code scanning dashboard (optional).
+ # Commenting out will disable upload of results to your repo's Code Scanning dashboard
+ - name: "Upload to code-scanning"
+ uses: github/codeql-action/upload-sarif@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.8
+ with:
+ sarif_file: results.sarif
diff --git a/.github/workflows/project_management_comment.yml b/.github/workflows/project_management_comment.yml
index bddf31549a..1ad6bf2036 100644
--- a/.github/workflows/project_management_comment.yml
+++ b/.github/workflows/project_management_comment.yml
@@ -4,6 +4,9 @@ on:
issues:
types:
- labeled
+permissions:
+ contents: read
+
jobs:
add-comment:
if: github.event.label.name == 'help wanted'
@@ -11,6 +14,11 @@ jobs:
permissions:
issues: write
steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
- name: Add comment
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
with:
diff --git a/.github/workflows/project_management_issue_open.yml b/.github/workflows/project_management_issue_open.yml
index 28ee771ed1..1377a416c2 100644
--- a/.github/workflows/project_management_issue_open.yml
+++ b/.github/workflows/project_management_issue_open.yml
@@ -4,13 +4,21 @@ on:
types:
- reopened
- opened
+permissions:
+ contents: read
+
jobs:
label_issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- - uses: actions/github-script@v7
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
github.rest.issues.addLabels({
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
index 8949173a42..931403638d 100644
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -3,11 +3,17 @@ on:
schedule:
- cron: "30 1 * * *"
+permissions:
+ contents: read
+
jobs:
stale:
+ permissions:
+ issues: write # for actions/stale to close stale issues
+ pull-requests: write # for actions/stale to close stale PRs
runs-on: ubuntu-latest
steps:
- - uses: actions/stale@v9
+ - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
stale-issue-message: "This issue was marked as stale due to lack of activity."
days-before-issue-stale: 60
diff --git a/.iwyu.imp b/.iwyu.imp
index 53fddd24aa..123e72f32d 100644
--- a/.iwyu.imp
+++ b/.iwyu.imp
@@ -6,8 +6,26 @@
[
# Work around for C++ STL
{ "include": ["", "private", "", "public"] },
+ { "include": ["", "private", "", "public"] },
+ { "include": ["", "private", "", "public"] },
+ { "include": ["", "private", "", "public"] },
+ { "include": ["", "private", "", "public"] },
- # Local opentelemetry-cpp
+ # Local opentelemetry-cpp style
+ # We prefer to include for simplicity
+ { "include": ["", "private", "", "public"] },
+ { "include": ["", "private", "", "public"] },
+ { "include": ["", "private", "", "public"] },
+ { "include": ["", "private", "", "public"] },
+ { "include": ["", "private", "", "public"] },
+ { "include": ["", "private", "", "public"] },
+
+ # We prefer to include for simplicity
+ { "include": ["", "private", "", "public"] },
+ { "include": ["", "private", "", "public"] },
+
+ # We prefer to include for simplicity
+ { "include": ["", "private", "", "public"] },
]
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 3532ca4d2a..c7ad6761dd 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -1,24 +1,33 @@
{
"version": "0.2.0",
"configurations": [
- {
- "name": "Debug on Windows",
- "type": "cppvsdbg",
- "request": "launch",
- "program": "${workspaceFolder}/build/",
- "args": [],
- "stopAtEntry": false,
- "cwd": "${workspaceFolder}",
- "environment": [],
- "externalConsole": false
- },
- {
- "name": "Debug on Linux",
- "type": "gdb",
- "request": "launch",
- "target": "${workspaceFolder}/bazel-bin/",
- "cwd": "${workspaceRoot}",
- "valuesFormatting": "parseText"
- }
+ {
+ "name": "(ctest) Launch",
+ "type": "cppdbg",
+ "cwd": "${cmake.testWorkingDirectory}",
+ "request": "launch",
+ "program": "${cmake.testProgram}",
+ "args": [ "${cmake.testArgs}" ],
+ // other options...
+ },
+ {
+ "name": "Debug on Windows",
+ "type": "cppvsdbg",
+ "request": "launch",
+ "program": "${workspaceFolder}/build/",
+ "args": [],
+ "stopAtEntry": false,
+ "cwd": "${workspaceFolder}",
+ "environment": [],
+ "externalConsole": false
+ },
+ {
+ "name": "Debug on Linux",
+ "type": "gdb",
+ "request": "launch",
+ "target": "${workspaceFolder}/bazel-bin/",
+ "cwd": "${workspaceRoot}",
+ "valuesFormatting": "parseText"
+ }
]
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6edb724131..bbcc8d708d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,1134 @@ Increment the:
## [Unreleased]
+* [TEST] Shared otel-cpp libs linked to latest static protobuf and grpc
+ [#3544](https://github.com/open-telemetry/opentelemetry-cpp/pull/3544)
+
+* [SDK] Implement env var configuration for PeriodicExportingMetricReader
+ [#3549](https://github.com/open-telemetry/opentelemetry-cpp/pull/3549)
+
+* [SDK] Update default exemplar reservoir size for exponential histograms
+ [#3551](https://github.com/open-telemetry/opentelemetry-cpp/pull/3551)
+
+* [SDK] Implements options for the ParentBasedSampler with default values
+ [#3553](https://github.com/open-telemetry/opentelemetry-cpp/pull/3553)
+
+* [SDK] View should not have a unit
+ [#3552](https://github.com/open-telemetry/opentelemetry-cpp/pull/3552)
+
+Breaking changes:
+
+* [SDK] View should not have a unit
+ [#3552](https://github.com/open-telemetry/opentelemetry-cpp/pull/3552)
+ * The `unit` parameter has been removed from the `View` constructor
+ and `ViewFactory::Create` methods.
+ * Please adjust SDK configuration code accordingly.
+
+## [1.22 2025-07-11]
+
+* [DOC] Udpate link to membership document
+ [#3452](https://github.com/open-telemetry/opentelemetry-cpp/pull/3452)
+
+* [CI] build examples with IWYU
+ [#3450](https://github.com/open-telemetry/opentelemetry-cpp/pull/3450)
+
+* Bump ossf/scorecard-action from 2.4.1 to 2.4.2
+ [#3455](https://github.com/open-telemetry/opentelemetry-cpp/pull/3455)
+
+* [SDK] Use shared_ptr internally for AttributesProcessor to prevent use-after-free
+ [#3457](https://github.com/open-telemetry/opentelemetry-cpp/pull/3457)
+
+* [CI] build iwyu
+ [#3459](https://github.com/open-telemetry/opentelemetry-cpp/pull/3459)
+
+* Bump github/codeql-action from 3.28.18 to 3.28.19
+ [#3462](https://github.com/open-telemetry/opentelemetry-cpp/pull/3462)
+
+* [DOC] Update doc comments to pass -WDocumention check
+ [#3375](https://github.com/open-telemetry/opentelemetry-cpp/pull/3375)
+
+* [TEST] test examples in CI with CMake Part 1
+ [#3449](https://github.com/open-telemetry/opentelemetry-cpp/pull/3449)
+
+* [BUILD] Allow compilation with CXX26
+ [#3464](https://github.com/open-telemetry/opentelemetry-cpp/pull/3464)
+
+* [SDK] Add credentials option to OTLP gRPC client
+ [#3403](https://github.com/open-telemetry/opentelemetry-cpp/pull/3403)
+
+* [CI] Remove windows 2019
+ [#3466](https://github.com/open-telemetry/opentelemetry-cpp/pull/3466)
+
+* [CodeHealth] fix include-what-you-use, part 8
+ [#3465](https://github.com/open-telemetry/opentelemetry-cpp/pull/3465)
+
+* [BUILD] Upgrade to opentelemetry-proto 1.7.0
+ [#3443](https://github.com/open-telemetry/opentelemetry-cpp/pull/3443)
+
+* Bump github/codeql-action from 3.28.19 to 3.29.0
+ [#3472](https://github.com/open-telemetry/opentelemetry-cpp/pull/3472)
+
+* Bump step-security/harden-runner from 2.12.0 to 2.12.1
+ [#3471](https://github.com/open-telemetry/opentelemetry-cpp/pull/3471)
+
+* [SDK] BatchLogRecordProcessor::ForceFlush is not waking up bg thread
+ [#3448](https://github.com/open-telemetry/opentelemetry-cpp/pull/3448)
+
+* [CI] rely on github installed cmake for ci runners
+ [#3482](https://github.com/open-telemetry/opentelemetry-cpp/pull/3482)
+
+* [CI] Increase code coverage of iwyu and clang-tidy ci jobs
+ [#3469](https://github.com/open-telemetry/opentelemetry-cpp/pull/3469)
+
+* [REMOVAL] Remove CMake option WITH_REMOVE_METER_PREVIEW
+ [#3476](https://github.com/open-telemetry/opentelemetry-cpp/pull/3476)
+
+* [REMOVAL] Removed deprecated semantic convention header files
+ [#3475](https://github.com/open-telemetry/opentelemetry-cpp/pull/3475)
+
+* Bump docker/setup-buildx-action from 3.10.0 to 3.11.0
+ [#3483](https://github.com/open-telemetry/opentelemetry-cpp/pull/3483)
+
+* Bump docker/setup-buildx-action from 3.11.0 to 3.11.1
+ [#3488](https://github.com/open-telemetry/opentelemetry-cpp/pull/3488)
+
+* [Code Health] include-what-you-use cleanup, part 9
+ [#3492](https://github.com/open-telemetry/opentelemetry-cpp/pull/3492)
+
+* [CodeHealth] Fix clang-tidy warnings part 1
+ [#3493](https://github.com/open-telemetry/opentelemetry-cpp/pull/3493)
+
+* [CMAKE] Add thirdparty install cmake project and install bash script
+ [#3486](https://github.com/open-telemetry/opentelemetry-cpp/pull/3486)
+
+* [DOC] Update community member listings
+ [#3499](https://github.com/open-telemetry/opentelemetry-cpp/pull/3499)
+
+* [CodeHealth] Fix clang-tidy warnings part 2
+ [#3496](https://github.com/open-telemetry/opentelemetry-cpp/pull/3496)
+
+* [CodeHealth] Fix clang-tidy warnings part 3
+ [#3498](https://github.com/open-telemetry/opentelemetry-cpp/pull/3498)
+
+* [DOC] Fix outdated community membership link
+ [#3500](https://github.com/open-telemetry/opentelemetry-cpp/pull/3500)
+
+* [CONFIGURATION] File configuration - trace model
+ [#3467](https://github.com/open-telemetry/opentelemetry-cpp/pull/3467)
+
+* [CONFIGURATION] File configuration - sampler model
+ [#3468](https://github.com/open-telemetry/opentelemetry-cpp/pull/3468)
+
+* [BUILD] Fixes grpc linking for OTLP exporter's tests
+ [#3435](https://github.com/open-telemetry/opentelemetry-cpp/pull/3435)
+
+* [CONFIGURATION] File configuration - log model
+ [#3473](https://github.com/open-telemetry/opentelemetry-cpp/pull/3473)
+
+* [CONFIGURATION] File configuration - metric model
+ [#3474](https://github.com/open-telemetry/opentelemetry-cpp/pull/3474)
+
+* Bump github/codeql-action from 3.29.0 to 3.29.1
+ [#3505](https://github.com/open-telemetry/opentelemetry-cpp/pull/3505)
+
+* [EXPORTER] Add bytes support for OTLP recordables
+ [#3495](https://github.com/open-telemetry/opentelemetry-cpp/pull/3495)
+
+* [CodeHealth] Fix clang tidy warnings part 4
+ [#3501](https://github.com/open-telemetry/opentelemetry-cpp/pull/3501)
+
+* [CodeHealth] Fix clang-tidy warnings part 5
+ [#3506](https://github.com/open-telemetry/opentelemetry-cpp/pull/3506)
+
+* [CI] Add minimum token permissions for all github workflow files
+ [#3508](https://github.com/open-telemetry/opentelemetry-cpp/pull/3508)
+
+* Bump step-security/harden-runner from 2.12.1 to 2.12.2
+ [#3509](https://github.com/open-telemetry/opentelemetry-cpp/pull/3509)
+
+* Bump github/codeql-action from 3.29.1 to 3.29.2
+ [#3510](https://github.com/open-telemetry/opentelemetry-cpp/pull/3510)
+
+* [BUILD] Fixes compiling problems in NDK r27
+ [#3517](https://github.com/open-telemetry/opentelemetry-cpp/pull/3517)
+
+* [CMAKE] clean up googletest and benchmark dependency management
+ [#3485](https://github.com/open-telemetry/opentelemetry-cpp/pull/3485)
+
+* [CONFIGURATION] File configuration - extension model
+ [#3503](https://github.com/open-telemetry/opentelemetry-cpp/pull/3503)
+
+* [CONFIGURATION] File configuration - misc model
+ [#3504](https://github.com/open-telemetry/opentelemetry-cpp/pull/3504)
+
+* [CONFIGURATION] File configuration - metric aggregation model
+ [#3502](https://github.com/open-telemetry/opentelemetry-cpp/pull/3502)
+
+* [CMAKE] find or fetch nlohmann-json
+ [#3523](https://github.com/open-telemetry/opentelemetry-cpp/pull/3523)
+
+* [CMAKE] Address the vcpkg opentelemetry-cpp port CMake patches
+ [#3518](https://github.com/open-telemetry/opentelemetry-cpp/pull/3518)
+
+* [CMAKE] Add CMake script to find or fetch prometheus-cpp
+ [#3522](https://github.com/open-telemetry/opentelemetry-cpp/pull/3522)
+
+* [CMAKE] Switch opentelemetry-proto to use FetchContent
+ [#3524](https://github.com/open-telemetry/opentelemetry-cpp/pull/3524)
+
+* [CMAKE] Add CMake script to find or fetch Microsoft.GSL
+ [#3521](https://github.com/open-telemetry/opentelemetry-cpp/pull/3521)
+
+* [SEMANTIC CONVENTIONS] Upgrade to semantic conventions 1.36.0
+ [#3527](https://github.com/open-telemetry/opentelemetry-cpp/pull/3527)
+
+* [SDK] Fixes duration overflow
+ [#3529](https://github.com/open-telemetry/opentelemetry-cpp/pull/3529)
+
+* [CONFIGURATION] File configuration - yaml parser
+ [#3519](https://github.com/open-telemetry/opentelemetry-cpp/pull/3519)
+
+* [CONFIGURATION] File configuration - configuration parser
+ [#3520](https://github.com/open-telemetry/opentelemetry-cpp/pull/3520)
+
+* [ADMIN] Remove file .github/repository-settings.md
+ [#3534](https://github.com/open-telemetry/opentelemetry-cpp/pull/3534)
+
+Important changes:
+
+* [REMOVAL] Removed deprecated semantic convention header files
+ [#3475](https://github.com/open-telemetry/opentelemetry-cpp/pull/3475)
+
+ * Old semantic conventions header files have been removed,
+ per announcement from Nov 9, 2024, see
+ [#3105](https://github.com/open-telemetry/opentelemetry-cpp/pull/3105)
+
+ * Mitigation steps are repeated below, for convenience.
+
+ * 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
+
+## [1.21 2025-05-28]
+
+* [BUILD] Remove WITH_ABSEIL
+ [#3318](https://github.com/open-telemetry/opentelemetry-cpp/pull/3318)
+
+* [INSTALL] Add CMake components to the opentelemetry-cpp package
+ [#3320](https://github.com/open-telemetry/opentelemetry-cpp/pull/3220)
+
+* [CI] Harden GitHub Actions
+ [#3338](https://github.com/open-telemetry/opentelemetry-cpp/pull/3338)
+
+* [StepSecurity] Harden GibHub Actions, part 2
+ [#3340](https://github.com/open-telemetry/opentelemetry-cpp/pull/3340)
+
+* Bump github/codeql-action from 3.28.12 to 3.28.13
+ [#3341](https://github.com/open-telemetry/opentelemetry-cpp/pull/3341)
+
+* [DEVCONTAINER] expose cmake version setting as docker arg and environment variable
+ [#3347](https://github.com/open-telemetry/opentelemetry-cpp/pull/3347)
+
+* [CI] disable bzip2 in conan builds
+ [#3352](https://github.com/open-telemetry/opentelemetry-cpp/pull/3352)
+
+* [SEMANTIC CONVENTIONS] Upgrade semantic conventions to 1.32.0
+ [#3351](https://github.com/open-telemetry/opentelemetry-cpp/pull/3351)
+
+* Bump github/codeql-action from 3.28.13 to 3.28.15
+ [#3353](https://github.com/open-telemetry/opentelemetry-cpp/pull/3353)
+
+* [CMAKE] bump cmake minimum required version to 3.14
+ [#3349](https://github.com/open-telemetry/opentelemetry-cpp/pull/3349)
+
+* Bump codecov/codecov-action from 5.4.0 to 5.4.2
+ [#3362](https://github.com/open-telemetry/opentelemetry-cpp/pull/3362)
+
+* [DOC] Fix documentation tags in logger API
+ [#3371](https://github.com/open-telemetry/opentelemetry-cpp/pull/3371)
+
+* [CI] fix artifacts download/upload
+ [#3369](https://github.com/open-telemetry/opentelemetry-cpp/pull/3369)
+
+* [API] Add Enabled method to Tracer
+ [#3357](https://github.com/open-telemetry/opentelemetry-cpp/pull/3357)
+
+* [BUILD] Fixes warnings of ciso646 in C++17
+ [#3360](https://github.com/open-telemetry/opentelemetry-cpp/pull/3360)
+
+* Bump github/codeql-action from 3.28.15 to 3.28.16
+ [#3377](https://github.com/open-telemetry/opentelemetry-cpp/pull/3377)
+
+* Bump step-security/harden-runner from 2.11.1 to 2.12.0
+ [#3373](https://github.com/open-telemetry/opentelemetry-cpp/pull/3373)
+
+* Bump docker/build-push-action from 6.15.0 to 6.16.0
+ [#3382](https://github.com/open-telemetry/opentelemetry-cpp/pull/3382)
+
+* Bump actions/download-artifact from 4.2.1 to 4.3.0
+ [#3381](https://github.com/open-telemetry/opentelemetry-cpp/pull/3381)
+
+* [CI] Harden Github actions - pinned-dependencies (part -1)
+ [#3380](https://github.com/open-telemetry/opentelemetry-cpp/pull/3380)
+
+* [StepSecurity] ci: Harden GitHub Actions
+ [#3378](https://github.com/open-telemetry/opentelemetry-cpp/pull/3378)
+
+* [SDK] Base2 exponential histogram aggregation
+ [#3346](https://github.com/open-telemetry/opentelemetry-cpp/pull/3346)
+
+* [StepSecurity] ci: Harden GitHub Actions
+ [#3379](https://github.com/open-telemetry/opentelemetry-cpp/pull/3379)
+
+* [BUILD] Fixes glibc++ 5 checking
+ [#3355](https://github.com/open-telemetry/opentelemetry-cpp/pull/3355)
+
+* [TEST] Add stress test for histogram metric for multiple threads validation
+ [#3388](https://github.com/open-telemetry/opentelemetry-cpp/pull/3388)
+
+* Bump github/codeql-action from 3.28.16 to 3.28.17
+ [#3389](https://github.com/open-telemetry/opentelemetry-cpp/pull/3389)
+
+* [SDK] Optimize PeriodicExportingMetricReader Thread Usage
+ [#3383](https://github.com/open-telemetry/opentelemetry-cpp/pull/3383)
+
+* [Metrics SDK] Use nostd::function_ref in AttributesHashMap
+ [#3393](https://github.com/open-telemetry/opentelemetry-cpp/pull/3393)
+
+* [SDK] support aggregation of identical instruments
+ [#3358](https://github.com/open-telemetry/opentelemetry-cpp/pull/3358)
+
+* [BUILD] Fixes unused var
+ [#3397](https://github.com/open-telemetry/opentelemetry-cpp/pull/3397)
+
+* [INSTALL] Unify cmake install functions and dynamically set component dependencies
+ [#3368](https://github.com/open-telemetry/opentelemetry-cpp/pull/3368)
+
+* [BUILD] Upgrade nlohmann_json to 3.12.0
+ [#3406](https://github.com/open-telemetry/opentelemetry-cpp/pull/3406)
+
+* [BUILD] Upgrade opentelemetry-proto to 1.6.0
+ [#3407](https://github.com/open-telemetry/opentelemetry-cpp/pull/3407)
+
+* [CMAKE] add generated protobuf headers to the opentelemetry_proto target
+ [#3400](https://github.com/open-telemetry/opentelemetry-cpp/pull/3400)
+
+* [MERGE] Fix accidental rollback of nlohmann-json submodule
+ [#3415](https://github.com/open-telemetry/opentelemetry-cpp/pull/3415)
+
+* Bump fossas/fossa-action from 1.6.0 to 1.7.0
+ [#3414](https://github.com/open-telemetry/opentelemetry-cpp/pull/3414)
+
+* Bump docker/build-push-action from 6.16.0 to 6.17.0
+ [#3420](https://github.com/open-telemetry/opentelemetry-cpp/pull/3420)
+
+* Bump codecov/codecov-action from 5.4.2 to 5.4.3
+ [#3419](https://github.com/open-telemetry/opentelemetry-cpp/pull/3419)
+
+* [SEMANTIC CONVENTIONS] Upgrade semantic conventions to 1.33
+ [#3416](https://github.com/open-telemetry/opentelemetry-cpp/pull/3416)
+
+* [DOCS] update the INSTALL guide on cmake components
+ [#3422](https://github.com/open-telemetry/opentelemetry-cpp/pull/3422)
+
+* Bump github/codeql-action from 3.28.17 to 3.28.18
+ [#3423](https://github.com/open-telemetry/opentelemetry-cpp/pull/3423)
+
+* [CMAKE] update cmake files in examples directory
+ [#3421](https://github.com/open-telemetry/opentelemetry-cpp/pull/3421)
+
+* [SDK] Fix Base2ExponentialHistogramAggregation Merge with empty buckets
+ [#3425](https://github.com/open-telemetry/opentelemetry-cpp/pull/3425)
+
+* [SDK] Fix MetricProducer interface
+ [#3413](https://github.com/open-telemetry/opentelemetry-cpp/pull/3413)
+
+* [CMAKE] remove global include_directories usage and rely on target properties
+ [#3426](https://github.com/open-telemetry/opentelemetry-cpp/pull/3426)
+
+* [BUILD] remove unused WITH_CURL build flag
+ [#3429](https://github.com/open-telemetry/opentelemetry-cpp/pull/3429)
+
+* [SEMANTIC CONVENTIONS] Upgrade to semantic conventions 1.34.0
+ [#3428](https://github.com/open-telemetry/opentelemetry-cpp/pull/3428)
+
+* [EXPORTER] ostream log exporter, fix memory ownership issues
+ [#3417](https://github.com/open-telemetry/opentelemetry-cpp/pull/3417)
+
+* [TEST] add all components to the cmake fetch content test
+ [#3433](https://github.com/open-telemetry/opentelemetry-cpp/pull/3433)
+
+* [BUILD] Error out when building DLL without MSVC
+ [#3438](https://github.com/open-telemetry/opentelemetry-cpp/pull/3438)
+
+* [BUILD] Add missing CMake keyword for target_link_libraries
+ [#3442](https://github.com/open-telemetry/opentelemetry-cpp/pull/3442)
+
+* [CMAKE] Remove third-party version mismatch warning
+ [#3432](https://github.com/open-telemetry/opentelemetry-cpp/pull/3432)
+
+* Bump docker/build-push-action from 6.17.0 to 6.18.0
+ [#3446](https://github.com/open-telemetry/opentelemetry-cpp/pull/3446)
+
+* [SEMANTIC CONVENTIONS] Fix comment style to preserve markup.
+ [#3444](https://github.com/open-telemetry/opentelemetry-cpp/pull/3444)
+
+* [EXPORTER] support unix sockets in grpc client
+ [#3410](https://github.com/open-telemetry/opentelemetry-cpp/pull/3410)
+
+* [BUILD] Propagate INTERFACE_COMPILE_DEFINITIONS from API through common_foo_library
+ [#3440](https://github.com/open-telemetry/opentelemetry-cpp/pull/3440)
+
+New Features:
+
+* [SDK] Base2 exponential histogram aggregation
+ [#3346](https://github.com/open-telemetry/opentelemetry-cpp/pull/3346)
+
+ * Add base2 exponential histogram aggregation. Includes a new aggregation type,
+ ostream exporter, and otlp/grpc exporter. Updated histogram aggregation and
+ benchmark tests.
+
+Important changes:
+
+* [EXPORTER] ostream log exporter, fixed memory ownership issues
+ [#3417](https://github.com/open-telemetry/opentelemetry-cpp/pull/3417)
+
+ * In the SDK, the following classes implementation has changed:
+
+ * opentelemetry::sdk::logs::ReadableLogRecord
+ * opentelemetry::sdk::logs::ReadWriteLogRecord
+
+ * An application implementing a custom log record exporter,
+ that reuses these classes from the opentelemetry-cpp SDK,
+ will need code adjustments, in particular for methods:
+
+ * GetBody()
+ * GetAttributes()
+
+ * Applications not using these SDK classes directly are not affected.
+
+* [BUILD] Remove WITH_ABSEIL
+ [#3318](https://github.com/open-telemetry/opentelemetry-cpp/pull/3318)
+
+ * The build option `WITH_ABSEIL` is no longer used, and opentelemetry-cpp
+ will no longer use any release of abseil provided externally,
+ for its own use.
+
+ * Instead, opentelemetry-cpp will only use an internal abseil version.
+
+ * This change resolves long standing binary integrity issues,
+ that occurred in the past when mixing several versions of abseil
+ in the build.
+
+## [1.20 2025-04-01]
+
+* [BUILD] Update opentelemetry-proto version
+ [#3254](https://github.com/open-telemetry/opentelemetry-cpp/pull/3254)
+
+* [BUILD] Build break with CURL 7.29.0
+ [#3255](https://github.com/open-telemetry/opentelemetry-cpp/pull/3255)
+
+* [SEMANTIC CONVENTIONS] Upgrade to semantic conventions 1.30.0
+ [#3258](https://github.com/open-telemetry/opentelemetry-cpp/pull/3258)
+
+* [SDK] Add tracer scope configurator
+ [#3137](https://github.com/open-telemetry/opentelemetry-cpp/pull/3137)
+
+* [DOC] Add document and example for sharing gRPC Client
+ [#3260](https://github.com/open-telemetry/opentelemetry-cpp/pull/3260)
+
+* [SDK] Fix BatchLogRecordProcessor to instrument shutdown
+ [#3262](https://github.com/open-telemetry/opentelemetry-cpp/pull/3262)
+
+* [SDK] Support OTEL_SDK_DISABLED environment variable
+ [#3245](https://github.com/open-telemetry/opentelemetry-cpp/pull/3245)
+
+* [CI] OTLP in Windows builds
+ [#3263](https://github.com/open-telemetry/opentelemetry-cpp/pull/3263)
+
+* [BUILD] Fixes compatibility of type_traits
+ [#3274](https://github.com/open-telemetry/opentelemetry-cpp/pull/3274)
+
+* [BUILD] Fix compilation with Regex being disabled
+ [#3276](https://github.com/open-telemetry/opentelemetry-cpp/pull/3276)
+
+* [EXPORTER] Support exporting event_name using OTLP Exporter
+ [#3277](https://github.com/open-telemetry/opentelemetry-cpp/pull/3277)
+
+* [CI] Add FOSSA scanning workflow
+ [#3279](https://github.com/open-telemetry/opentelemetry-cpp/pull/3279)
+
+* [BUILD] Adding typecast without whom c++latest build fails
+ [#3281](https://github.com/open-telemetry/opentelemetry-cpp/pull/3281)
+
+* [ADMIN] Add FOSSA badges
+ [#3280](https://github.com/open-telemetry/opentelemetry-cpp/pull/3280)
+
+* [BUILD] Fix compiling problems with abiv2 and MSVC
+ [#3284](https://github.com/open-telemetry/opentelemetry-cpp/pull/3284)
+
+* [BUILD] Enable old behavior of CMP0092
+ [#3269](https://github.com/open-telemetry/opentelemetry-cpp/pull/3269)
+
+* [SDK] Add meter scope configurator
+ [#3268](https://github.com/open-telemetry/opentelemetry-cpp/pull/3268)
+
+* [DEVCONTAINER] Support customization and run as non-root user
+ [#3270](https://github.com/open-telemetry/opentelemetry-cpp/pull/3270)
+
+* [ETW] Add configuration to export 64-bit integer as timestamp
+ [#3286](https://github.com/open-telemetry/opentelemetry-cpp/pull/3286)
+
+* [API] Deprecate event logger
+ [#3285](https://github.com/open-telemetry/opentelemetry-cpp/pull/3285)
+
+* [BUILD] Add link directory to support curl 8.12
+ [#3272](https://github.com/open-telemetry/opentelemetry-cpp/pull/3272)
+
+* [API] Change the param-pack unpacking order to start from left to right
+ [#3296](https://github.com/open-telemetry/opentelemetry-cpp/pull/3296)
+
+* [SDK] Implement spec: MetricFilter
+ [#3235](https://github.com/open-telemetry/opentelemetry-cpp/pull/3235)
+
+* [SEMANTIC CONVENTIONS] Upgrade semantic conventions to 1.31.0
+ [#3297](https://github.com/open-telemetry/opentelemetry-cpp/pull/3297)
+
+* [SDK] Add logger scope configurator
+ [#3282](https://github.com/open-telemetry/opentelemetry-cpp/pull/3282)
+
+* [EXAMPLE] fix buffer overrun in the gRPC sample project
+ [#3304](https://github.com/open-telemetry/opentelemetry-cpp/pull/3304)
+
+* [CI] Bump fossas/fossa-action from 1.5.0 to 1.6.0
+ [#3305](https://github.com/open-telemetry/opentelemetry-cpp/pull/3305)
+
+* [TEST] fix segfault in singleton test with cmake on macos-latest
+ [#3316](https://github.com/open-telemetry/opentelemetry-cpp/pull/3316)
+
+* [TEST] fix test failure with elasticsearch exporter on cxx20
+ [#3308](https://github.com/open-telemetry/opentelemetry-cpp/pull/3308)
+
+* [TEST] otlp grpc exporter retry test fix
+ [#3311](https://github.com/open-telemetry/opentelemetry-cpp/pull/3311)
+
+* [SDK] Use OPENTELEMETRY_EXPORT and static local variables
+ [#3314](https://github.com/open-telemetry/opentelemetry-cpp/pull/3314)
+
+* [BUILD] Fix elasticsearch exporter json compatibility
+ [#3313](https://github.com/open-telemetry/opentelemetry-cpp/pull/3313)
+
+* [BUILD] Fix missing exported definition for OTLP file exporter and forceflush
+ [#3319](https://github.com/open-telemetry/opentelemetry-cpp/pull/3319)
+
+* [BUILD] Remove gRPC header including in OtlpGrpcClientFactory
+ [#3321](https://github.com/open-telemetry/opentelemetry-cpp/pull/3321)
+
+* [ADMIN] Add Pranav Sharma in cpp-approvers
+ [#3323](https://github.com/open-telemetry/opentelemetry-cpp/pull/3323)
+
+* [DEVCONTAINER] fix grpc install
+ [#3325](https://github.com/open-telemetry/opentelemetry-cpp/pull/3325)
+
+* [ADMIN] Add dbarker to approvers
+ [#3331](https://github.com/open-telemetry/opentelemetry-cpp/pull/3331)
+
+* [CI] Upgrade CI to ubuntu 22.04
+ [#3330](https://github.com/open-telemetry/opentelemetry-cpp/pull/3330)
+
+* [CI] Add ossf-scorecard scanning workflow
+ [#3332](https://github.com/open-telemetry/opentelemetry-cpp/pull/3332)
+
+* [CI] pin cmake in ci and devcontainer
+ [#3336](https://github.com/open-telemetry/opentelemetry-cpp/pull/3336)
+
+* [METRICS SDK] Fix hash collision in MetricAttributes
+ [#3322](https://github.com/open-telemetry/opentelemetry-cpp/pull/3322)
+
+Important changes:
+
+* [SDK] Support OTEL_SDK_DISABLED environment variable
+ [#3245](https://github.com/open-telemetry/opentelemetry-cpp/pull/3245)
+
+ * The SDK now exposes the following new methods:
+
+ * opentelemetry::sdk::trace::Provider::SetTracerProvider()
+ * opentelemetry::sdk::metrics::Provider::SetMeterProvider()
+ * opentelemetry::sdk::logs::Provider::SetLoggerProvider()
+
+ * These methods do support the `OTEL_SDK_DISABLED` environment variable,
+ unlike the corresponding existing API Provider classes.
+
+ * Applications are encouraged to migrate from the API to the SDK
+ `Provider` classes, to benefit from this feature.
+
+ * All the example code has been updated to reflect the new usage.
+
+## [1.19 2025-01-22]
+
+* [PROMETHEUS_EXPORTER] Fix default for emitting otel_scope attributes
+ [#3171](https://github.com/open-telemetry/opentelemetry-cpp/pull/3171)
+
+* [Code health] Include what you use cleanup, part 5
+ [#3140](https://github.com/open-telemetry/opentelemetry-cpp/pull/3140)
+
+* [BUILD] Upgrade cmake
+ [#3167](https://github.com/open-telemetry/opentelemetry-cpp/pull/3167)
+
+* [SHIM] Fix string_view mappings between OT and OTel
+ [#3181](https://github.com/open-telemetry/opentelemetry-cpp/pull/3181)
+
+* [EXPORTER] Refactor ElasticSearchRecordable
+ [#3164](https://github.com/open-telemetry/opentelemetry-cpp/pull/3164)
+
+* [SEMANTIC CONVENTIONS] Upgrade to semantic conventions 1.29.0
+ [#3182](https://github.com/open-telemetry/opentelemetry-cpp/pull/3182)
+
+* [BUILD] Fix cross-compilation with protoc
+ [#3186](https://github.com/open-telemetry/opentelemetry-cpp/pull/3186)
+
+* [Code health] Perform cppcheck cleanup
+ [#3150](https://github.com/open-telemetry/opentelemetry-cpp/pull/3150)
+
+* [EXPORTER] add instrumentation scope attributes
+ to otlp proto messages for traces and metrics
+ [#3185](https://github.com/open-telemetry/opentelemetry-cpp/pull/3185)
+
+* [SDK] Tracer provider shutdown blocks in-definitively
+ [#3191](https://github.com/open-telemetry/opentelemetry-cpp/pull/3191)
+
+* [SEMANTIC CONVENTIONS] Upgrade to weaver 0.11.0
+ [#3194](https://github.com/open-telemetry/opentelemetry-cpp/pull/3194)
+
+* [DOC] Update existing maintaining dependencies doc
+ [#3195](https://github.com/open-telemetry/opentelemetry-cpp/pull/3195)
+
+* [TEST] Change is_called_ and got_response_ to use atomic
+ [#3204](https://github.com/open-telemetry/opentelemetry-cpp/pull/3204)
+
+* [SEMANTIC CONVENTIONS] update links to openmetrics to reference the v1.0.0 release
+ [#3205](https://github.com/open-telemetry/opentelemetry-cpp/pull/3205)
+
+* [CI] Fix CI on ubuntu-latest
+ [#3207](https://github.com/open-telemetry/opentelemetry-cpp/pull/3207)
+
+* [BUILD] Build break using protoc 3.14
+ [#3211](https://github.com/open-telemetry/opentelemetry-cpp/pull/3211)
+
+* [TEST] Build the singleton test on windows
+ [#3183](https://github.com/open-telemetry/opentelemetry-cpp/pull/3183)
+
+* [BUILD] Add cxx feature detections
+ [#3203](https://github.com/open-telemetry/opentelemetry-cpp/pull/3203)
+
+* [SDK] Do not frequently create and destroy http client threads
+ [#3198](https://github.com/open-telemetry/opentelemetry-cpp/pull/3198)
+
+* [EXPORTER] Optimize OTLP HTTP compression
+ [#3178](https://github.com/open-telemetry/opentelemetry-cpp/pull/3178)
+
+* [SDK] Fix include instrumentation scope attributes in equal method
+ [#3214](https://github.com/open-telemetry/opentelemetry-cpp/pull/3214)
+
+* Upgrade to opentelemetry-proto 1.5.0
+ [#3210](https://github.com/open-telemetry/opentelemetry-cpp/pull/3210)
+
+* [TEST] Added support for SELINUX in functional tests
+ [#3212](https://github.com/open-telemetry/opentelemetry-cpp/pull/3212)
+
+* [EDITORIAL] fix changelog entry for PR 3185
+ [#3217](https://github.com/open-telemetry/opentelemetry-cpp/pull/3217)
+
+* [TEST] Functional tests for OTLP/gRPC with mutual TLS
+ [#3227](https://github.com/open-telemetry/opentelemetry-cpp/pull/3227)
+
+* [SEMCONV] Metrics are incorrectly prefixed with 'metric'
+ [#3228](https://github.com/open-telemetry/opentelemetry-cpp/pull/3228)
+
+* [BUILD] Add OTLP/file exporter for dll and examples
+ [#3231](https://github.com/open-telemetry/opentelemetry-cpp/pull/3231)
+
+* [Code Health] Include what you use, part 6
+ [#3216](https://github.com/open-telemetry/opentelemetry-cpp/pull/3216)
+
+* [CI] Spurious test failures
+ [#3233](https://github.com/open-telemetry/opentelemetry-cpp/pull/3233)
+
+* [BUILD] Fix error ‘uint8_t’ does not name a type with gcc-15
+ [#3240](https://github.com/open-telemetry/opentelemetry-cpp/pull/3240)
+
+* [EXPORTER] fix throw in OtlpGrpcMetricExporter with shared grpc client
+ [#3243](https://github.com/open-telemetry/opentelemetry-cpp/pull/3243)
+
+* [SDK] Better control of threads executed by opentelemetry-cpp
+ [#3175](https://github.com/open-telemetry/opentelemetry-cpp/pull/3175)
+
+* [Code Health] Include what you use, part 7
+ [#3238](https://github.com/open-telemetry/opentelemetry-cpp/pull/3238)
+
+* [SDK] Fix lifetime of GlobalLogHandler
+ [#3221](https://github.com/open-telemetry/opentelemetry-cpp/pull/3221)
+
+* [MAINTAINER] Add devcontainer
+ [#3123](https://github.com/open-telemetry/opentelemetry-cpp/pull/3123)
+
+* [SDK] enable deriving from ResourceDetector to create a Resource
+ [#3247](https://github.com/open-telemetry/opentelemetry-cpp/pull/3247)
+
+* [EXPORTER] Support handling retry-able errors for OTLP/HTTP
+ [#3223](https://github.com/open-telemetry/opentelemetry-cpp/pull/3223)
+
+* [CI] Add GRPC in maintainer CI
+ [#3248](https://github.com/open-telemetry/opentelemetry-cpp/pull/3248)
+
+* [EXPORTER] Support handling retry-able errors for OTLP/gRPC
+ [#3219](https://github.com/open-telemetry/opentelemetry-cpp/pull/3219)
+
+* [SDK] Optimize Metric Processing for Single Collector with Delta Temporality
+ [#3236](https://github.com/open-telemetry/opentelemetry-cpp/pull/3236)
+
+New features:
+
+* [SDK] Better control of threads executed by opentelemetry-cpp
+ [#3175](https://github.com/open-telemetry/opentelemetry-cpp/pull/3175)
+
+ * This feature provides a way for applications,
+ when configuring the SDK and exporters,
+ to participate in the execution path
+ of internal opentelemetry-cpp threads.
+
+ * The opentelemetry-cpp library provides the following:
+
+ * a new ThreadInstrumentation interface,
+ * new runtime options structures, to optionally configure the SDK:
+ * BatchSpanProcessorRuntimeOptions
+ * PeriodicExportingMetricReaderRuntimeOptions
+ * BatchLogRecordProcessorRuntimeOptions
+ * new runtime options structures,
+ to optionally configure the OTLP HTTP exporters:
+ * OtlpHttpExporterRuntimeOptions
+ * OtlpHttpMetricExporterRuntimeOptions
+ * OtlpHttpLogRecordExporterRuntimeOptions
+ * new ThreadInstrumentation parameters,
+ to optionally configure the CURL HttpClient
+ * new runtime options structures,
+ to optionally configure the OTLP FILE exporters:
+ * OtlpFileExporterRuntimeOptions
+ * OtlpFileMetricExporterRuntimeOptions
+ * OtlpFileLogRecordExporterRuntimeOptions
+ * new runtime options structure,
+ to optionally configure the OTLP FILE client:
+ * OtlpFileClientRuntimeOptions
+
+ * Using the optional runtime options structures,
+ an application can subclass the ThreadInstrumentation interface,
+ and be notified of specific events of interest during the execution
+ of an internal opentelemetry-cpp thread.
+
+ * This allows an application to call, for example:
+
+ * pthread_setaffinity_np(), for better performances,
+ * setns(), to control the network namespace used by HTTP CURL connections
+ * pthread_setname_np(), for better observability from the operating system
+ * many more specific apis, as needed
+
+ * See the documentation for ThreadInstrumentation for details.
+
+ * A new example program, example_otlp_instrumented_http,
+ shows how to use the feature,
+ and add application logic in the thread execution code path.
+
+ * Note that this feature is experimental,
+ protected by a WITH_THREAD_INSTRUMENTATION_PREVIEW
+ flag in CMake. Various runtime options structures,
+ as well as the thread instrumentation interface,
+ may change without notice before this feature is declared stable.
+
+* [EXPORTER] Support handling retry-able errors for OTLP/HTTP
+ [#3223](https://github.com/open-telemetry/opentelemetry-cpp/pull/3223)
+
+ * This feature is experimental,
+ protected by a WITH_OTLP_RETRY_PREVIEW
+ flag in CMake.
+
+* [EXPORTER] Support handling retry-able errors for OTLP/gRPC
+ [#3219](https://github.com/open-telemetry/opentelemetry-cpp/pull/3219)
+
+ * This feature is experimental,
+ protected by a WITH_OTLP_RETRY_PREVIEW
+ flag in CMake.
+
+## [1.18 2024-11-25]
+
+* [EXPORTER] Fix crash in ElasticsearchLogRecordExporter
+ [#3082](https://github.com/open-telemetry/opentelemetry-cpp/pull/3082)
+
+* [BUILD] Avoid buggy warning with gcc <= 8
+ [#3087](https://github.com/open-telemetry/opentelemetry-cpp/pull/3087)
+
+* [API] Jaeger Propagator should not be deprecated
+ [#3086](https://github.com/open-telemetry/opentelemetry-cpp/pull/3086)
+
+* Update bzlmod version
+ [#3093](https://github.com/open-telemetry/opentelemetry-cpp/pull/3093)
+
+* [BUILD] Remove std::make_unique
+ [#3098](https://github.com/open-telemetry/opentelemetry-cpp/pull/3098)
+
+* [BUILD] Fix compiling problems for gcc 4.8
+ [#3100](https://github.com/open-telemetry/opentelemetry-cpp/pull/3100)
+
+* [TEST] Fix linking order and gmock linking
+ [#3106](https://github.com/open-telemetry/opentelemetry-cpp/pull/3106)
+
+* [EXPORTER] Add config options to prometheus exporter
+ [#3104](https://github.com/open-telemetry/opentelemetry-cpp/pull/3104)
+
+* [BUILD] Add a CMake option to disable shared libs
+ [#3095](https://github.com/open-telemetry/opentelemetry-cpp/pull/3095)
+
+* [EXPORTER] Remove out of date ETW exporter doc
+ [#3103](https://github.com/open-telemetry/opentelemetry-cpp/pull/3103)
+
+* [EXPORTER] Add logging for async gRPC errors
+ [#3108](https://github.com/open-telemetry/opentelemetry-cpp/pull/3108)
+
+* [BUILD] Remove aligned_storage from nostd
+ [#3112](https://github.com/open-telemetry/opentelemetry-cpp/pull/3112)
+
+* [EXPORTER] Elastic Search exporter follow ECS guidelines
+ [#3107](https://github.com/open-telemetry/opentelemetry-cpp/pull/3107)
+
+* [INSTALL] Resolve dependencies in opentelemetry-cpp-config.cmake
+ [#3094](https://github.com/open-telemetry/opentelemetry-cpp/pull/3094)
+
+* [API] Add synchronous gauge
+ [#3029](https://github.com/open-telemetry/opentelemetry-cpp/pull/3029)
+
+* [BUILD] allow building with -DWITH_OTLP_HTTP_COMPRESSION=OFF without zlib
+ [#3120](https://github.com/open-telemetry/opentelemetry-cpp/pull/3120)
+
+* [CI] Comment the arm64 CI
+ [#3125](https://github.com/open-telemetry/opentelemetry-cpp/pull/3125)
+
+* [API] Comply with W3C Trace Context
+ [#3115](https://github.com/open-telemetry/opentelemetry-cpp/pull/3115)
+
+* [EXPORTER] bump prometheus to v1.3.0
+ [#3122](https://github.com/open-telemetry/opentelemetry-cpp/pull/3122)
+
+* [EXPORTER] Log SSL Connection Information
+ [#3113](https://github.com/open-telemetry/opentelemetry-cpp/pull/3113)
+
+* [BUILD] Improve how to handle yield() in ARM
+ [#3129](https://github.com/open-telemetry/opentelemetry-cpp/pull/3129)
+
+* [BUILD] Fix -Wmissing-template-arg-list-after-template-kw warning
+ [#3133](https://github.com/open-telemetry/opentelemetry-cpp/pull/3133)
+
+* [EXPORTER]: Elasticsearch exporter put log resource in root instead of under 'resources'
+ [#3131](https://github.com/open-telemetry/opentelemetry-cpp/pull/3131)
+
+* [TEST] Rename w3c_tracecontext_test to w3c_tracecontext_http_test_server
+ [#3132](https://github.com/open-telemetry/opentelemetry-cpp/pull/3132)
+
+* [BUILD] Patches for building on AIX
+ [#3127](https://github.com/open-telemetry/opentelemetry-cpp/pull/3127)
+
+* [SEMANTIC CONVENTIONS] Migration to weaver
+ [#3105](https://github.com/open-telemetry/opentelemetry-cpp/pull/3105)
+
+* [SEMANTIC CONVENTIONS] Upgrade to semantic conventions 1.28.0
+ [#3139](https://github.com/open-telemetry/opentelemetry-cpp/pull/3139)
+
+* [EXPORTER] handling of invalid ports in UrlParser
+ [#3142](https://github.com/open-telemetry/opentelemetry-cpp/pull/3142)
+
+* [CI] speed up clang-tidy workflow
+ [#3148](https://github.com/open-telemetry/opentelemetry-cpp/pull/3148)
+
+* [EXPORTER] Allow to share gRPC clients between OTLP exporters
+ [#3041](https://github.com/open-telemetry/opentelemetry-cpp/pull/3041)
+
+* Bump codecov/codecov-action from 4 to 5
+ [#3143](https://github.com/open-telemetry/opentelemetry-cpp/pull/3143)
+
+* [CI] Add cppcheck in the build
+ [#3151](https://github.com/open-telemetry/opentelemetry-cpp/pull/3151)
+
+* [BUILD] Fix error message
+ [#3152](https://github.com/open-telemetry/opentelemetry-cpp/pull/3152)
+
+* [EXPORTER] fix clang-tidy warnings in UrlParser
+ [#3146](https://github.com/open-telemetry/opentelemetry-cpp/pull/3146)
+
+* [EXPORTER] Upgrade to opentelemetry-proto 1.4.0
+ [#3157](https://github.com/open-telemetry/opentelemetry-cpp/pull/3157)
+
+* [TEST] refactor UrlParser tests to use value-paramterized tests
+ [#3153](https://github.com/open-telemetry/opentelemetry-cpp/pull/3153)
+
+* [TEST] add a test for ElasticSearchRecordable
+ [#3154](https://github.com/open-telemetry/opentelemetry-cpp/pull/3154)
+
+* [BUILD] Fix missing dependency on protoc compiler
+ [#3159](https://github.com/open-telemetry/opentelemetry-cpp/pull/3159)
+
+* [bazel] Update prometheus-cpp in MODULE.bazel
+ [#3162](https://github.com/open-telemetry/opentelemetry-cpp/pull/3162)
+
+* [bazel] Enable --incompatible_disallow_empty_glob
+ [#2642](https://github.com/open-telemetry/opentelemetry-cpp/pull/2642)
+
+* [INSTALL] Fix cmake/opentelemetry-cpp-config.cmake.in
+ [#3165](https://github.com/open-telemetry/opentelemetry-cpp/pull/3165)
+
+* [BUILD] Do not set OTELCPP_PROTO_PATH in the CMake cache
+ [#3160](https://github.com/open-telemetry/opentelemetry-cpp/pull/3160)
+
+* [BUILD] Fix build for esp32
+ [#3155](https://github.com/open-telemetry/opentelemetry-cpp/pull/3155)
+
+* [bazel] Update opentelemetry-proto in MODULE.bazel
+ [#3163](https://github.com/open-telemetry/opentelemetry-cpp/pull/3163)
+
+Important changes:
+
+* [API] Jaeger Propagator should not be deprecated
+ [#3086](https://github.com/open-telemetry/opentelemetry-cpp/pull/3086)
+
+ * Deprecation of the Jaeger propagator, as announced on 2023-01-31
+ in version 1.8.2, is now reverted.
+ * This deprecation turned out to be not justified,
+ as the Jaeger propagator can be used without the (now removed)
+ Jaeger exporter.
+
+* [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.
+
+Deprecations:
+
+* This release contains deprecations, see file DEPRECATED.md for details.
+
+## [1.17 2024-10-07]
+
+* [CI] Add a clang-tidy build
+ [#3001](https://github.com/open-telemetry/opentelemetry-cpp/pull/3001)
+
+* [BUILD] Upgrade to opentelemetry-proto 1.3.2
+ [#2991](https://github.com/open-telemetry/opentelemetry-cpp/pull/2991)
+
+* [REMOVAL] Remove build option `WITH_DEPRECATED_SDK_FACTORY`
+ [#2717](https://github.com/open-telemetry/opentelemetry-cpp/pull/2717)
+
+* [EXPORTER] ForceFlush before canceling the running requests on shutdown
+ [#2727](https://github.com/open-telemetry/opentelemetry-cpp/pull/2727)
+
+* [SDK] Fix crash in PeriodicExportingMetricReader
+ [#2983](https://github.com/open-telemetry/opentelemetry-cpp/pull/2983)
+
+* [SDK] Fix memory leak in TlsRandomNumberGenerator() constructor
+ [#2661](https://github.com/open-telemetry/opentelemetry-cpp/pull/2661)
+
+* [EXPORTER] Ignore exception when create thread in OTLP file exporter
+ [#3012](https://github.com/open-telemetry/opentelemetry-cpp/pull/3012)
+
+* [BUILD] Update the version in MODULE.bazel
+ [#3015](https://github.com/open-telemetry/opentelemetry-cpp/pull/3015)
+
+* [BUILD] Fix build without vcpkg on Windows when gRPC is disabled
+ [#3016](https://github.com/open-telemetry/opentelemetry-cpp/pull/3016)
+
+* [BUILD] Add abi_version_no bazel flag
+ [#3020](https://github.com/open-telemetry/opentelemetry-cpp/pull/3020)
+
+* [Code health] Expand iwyu coverage to include unit tests
+ [#3022](https://github.com/open-telemetry/opentelemetry-cpp/pull/3022)
+
+* [BUILD] Version opentelemetry_proto/proto_grpc shared libraries
+ [#2992](https://github.com/open-telemetry/opentelemetry-cpp/pull/2992)
+
+* [SEMANTIC CONVENTIONS] Upgrade semantic conventions to 1.27.0
+ [#3023](https://github.com/open-telemetry/opentelemetry-cpp/pull/3023)
+
+* [SDK] Support empty histogram buckets
+ [#3027](https://github.com/open-telemetry/opentelemetry-cpp/pull/3027)
+
+* [TEST] Fix sync problems in OTLP File exporter tests
+ [#3031](https://github.com/open-telemetry/opentelemetry-cpp/pull/3031)
+
+* [SDK] PeriodicExportingMetricReader: future is never set, blocks until timeout
+ [#3030](https://github.com/open-telemetry/opentelemetry-cpp/pull/3030)
+
+* [Code Health] Clang Tidy cleanup, Part 2
+ [#3038](https://github.com/open-telemetry/opentelemetry-cpp/pull/3038)
+
+* [Code Health] include-what-you-use cleanup, part 3
+ [#3004](https://github.com/open-telemetry/opentelemetry-cpp/pull/3004)
+
+* [SDK] Fix overflow in timeout logic
+ [#3046](https://github.com/open-telemetry/opentelemetry-cpp/pull/3046)
+
+* [TEST] Add missing tests to Bazel build
+ [#3045](https://github.com/open-telemetry/opentelemetry-cpp/pull/3045)
+
+* [TEST] update collector tests with debug exporter
+ [#3050](https://github.com/open-telemetry/opentelemetry-cpp/pull/3050)
+
+* [EXAMPLE] update collector example with debug exporter
+ [#3049](https://github.com/open-telemetry/opentelemetry-cpp/pull/3049)
+
+* [TEST] update references to logging exporter
+ [#3053](https://github.com/open-telemetry/opentelemetry-cpp/pull/3053)
+
+* [EXAMPLE] Clean the tracer initialization in OStream example
+ [#3051](https://github.com/open-telemetry/opentelemetry-cpp/pull/3051)
+
+* [EXPORTER] Fix the format of SpanLink for ETW
+ [#3054](https://github.com/open-telemetry/opentelemetry-cpp/pull/3054)
+
+* [EXPORTER] Add in-memory metric exporter
+ [#3043](https://github.com/open-telemetry/opentelemetry-cpp/pull/3043)
+
+* [Code Health] include-what-you-use cleanup, part 4
+ [#3040](https://github.com/open-telemetry/opentelemetry-cpp/pull/3040)
+
+* [BUILD] add loongarch info
+ [#3052](https://github.com/open-telemetry/opentelemetry-cpp/pull/3052)
+
+* [CI] Update otel-collector version
+ [#3067](https://github.com/open-telemetry/opentelemetry-cpp/pull/3067)
+
+* [SDK] Update MetricProducer interface to match spec
+ [#3044](https://github.com/open-telemetry/opentelemetry-cpp/pull/3044)
+
+* [EXPORTER] Fix URL in ES exporter, fix ipv6 supporting for http client
+ [#3081](https://github.com/open-telemetry/opentelemetry-cpp/pull/3081)
+
+* [EXPORTER] Add HttpHeaders in ElasticsearchLogRecordExporter
+ [#3083](https://github.com/open-telemetry/opentelemetry-cpp/pull/3083)
+
+Breaking changes:
+
+* [REMOVAL] Remove build option `WITH_DEPRECATED_SDK_FACTORY`
+ [#2717](https://github.com/open-telemetry/opentelemetry-cpp/pull/2717)
+
+ * As announced in opentelemetry-cpp previous release 1.16.0,
+ CMake option `WITH_DEPRECATED_SDK_FACTORY` was temporary,
+ and to be removed by the next release.
+ * This option is now removed.
+ * Code configuring the SDK must be adjusted, as previously described:
+
+ * [API/SDK] Provider cleanup
+ [#2664](https://github.com/open-telemetry/opentelemetry-cpp/pull/2664)
+
+ * Before this fix:
+ * SDK factory methods such as:
+ * opentelemetry::sdk::trace::TracerProviderFactory::Create()
+ * opentelemetry::sdk::metrics::MeterProviderFactory::Create()
+ * opentelemetry::sdk::logs::LoggerProviderFactory::Create()
+ * opentelemetry::sdk::logs::EventLoggerProviderFactory::Create()
+
+ returned an API object (opentelemetry::trace::TracerProvider)
+ to the caller.
+
+ * After this fix, these methods return an SDK level object
+ (opentelemetry::sdk::trace::TracerProvider) to the caller.
+ * Returning an SDK object is necessary for the application to
+ cleanup and invoke SDK level methods, such as ForceFlush(),
+ on a provider.
+ * The application code that configures the SDK, by calling
+ the various provider factories, may need adjustment.
+ * All the examples have been updated, and in particular no
+ longer perform static_cast do convert an API object to an SDK object.
+ Please refer to examples for guidance on how to adjust.
+
+## [1.16.1 2024-07-17]
+
+* [BUILD] Add bazel missing BUILD file
+ [#2720](https://github.com/open-telemetry/opentelemetry-cpp/pull/2720)
+
+* [SDK] Added reserve for spans array in BatchSpanProcessor.
+ [#2724](https://github.com/open-telemetry/opentelemetry-cpp/pull/2724)
+
+* [DOC] Update "Using triplets" section in building-with-vcpkg documentation.
+ [#2726](https://github.com/open-telemetry/opentelemetry-cpp/pull/2726)
+
+* [DOC] Remove comment for unused LoggerProvider initialization params
+ [#2972](https://github.com/open-telemetry/opentelemetry-cpp/pull/2972)
+
+* [SECURITY] Remove OTLP HTTP support for TLS 1.0 and TLS 1.1,
+ require TLS 1.2 or better
+ [#2722](https://github.com/open-telemetry/opentelemetry-cpp/pull/2722)
+
+* [TEST] Fix opentelemetry-collector bind address
+ [#2989](https://github.com/open-telemetry/opentelemetry-cpp/pull/2989)
+
+* [EXPORTER] Fix references in AttributeValueVisitor
+ [#2985](https://github.com/open-telemetry/opentelemetry-cpp/pull/2985)
+
+* [Code health] include-what-you-use cleanup, part 2
+ [#2704](https://github.com/open-telemetry/opentelemetry-cpp/pull/2704)
+
+* [Code Health] clang-tidy cleanup, part 1
+ [#2990](https://github.com/open-telemetry/opentelemetry-cpp/pull/2990)
+
+* [CI] Build failures with ABSEIL 20240116 and CMAKE 3.30
+ [#3002](https://github.com/open-telemetry/opentelemetry-cpp/pull/3002)
+
+* [CI] Enable bzlmod
+ [#2995](https://github.com/open-telemetry/opentelemetry-cpp/pull/2995)
+
+* [Metrics SDK] Fix hash calculation for nostd::string
+ [#2999](https://github.com/open-telemetry/opentelemetry-cpp/pull/2999)
+
+Breaking changes:
+
+* [SECURITY] Remove OTLP HTTP support for TLS 1.0 and TLS 1.1,
+ require TLS 1.2 or better
+ [#2722](https://github.com/open-telemetry/opentelemetry-cpp/pull/2722)
+ * The OTLP HTTP exporter no longer accept options like:
+ * min_TLS = 1.0
+ * min_TLS = 1.1
+ * max_TLS = 1.0
+ * max_TLS = 1.1
+ * When connecting to an OTLP HTTP endpoint, using `https`,
+ the connection will require TLS 1.2 by default,
+ unless min_TLS is set to 1.3
+ * Plain `http` connections (insecure) are not affected.
+
## [1.16.0] 2024-06-21
* [BUILD] Upgrade bazel abseil from 20220623.1 to 20230802.2
@@ -299,7 +1427,7 @@ Important changes:
* [ETW EXPORTER] Remove namespace using in ETW exporter which affects global
namespace
[#2531](https://github.com/open-telemetry/opentelemetry-cpp/pull/2531)
-* [BUILD] Don't invoke vcpkg from this repo with CMAKE_TOOLCHAIN_FILE set
+* [BUILD] Don't invoke vcpkg from this repo with CMAKE_TOOLCHAIN_FILE set
[#2527](https://github.com/open-telemetry/opentelemetry-cpp/pull/2527)
* [EXPORTER] Async exporting for otlp grpc
[#2407](https://github.com/open-telemetry/opentelemetry-cpp/pull/2407)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 711ac14c4c..1a6f9cf99a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,90 +1,71 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
-cmake_minimum_required(VERSION 3.9)
+cmake_minimum_required(VERSION 3.14)
-# See https://cmake.org/cmake/help/v3.3/policy/CMP0057.html required by certain
-# versions of gtest
-cmake_policy(SET CMP0057 NEW)
-
-# See https://cmake.org/cmake/help/v3.12/policy/CMP0074.html required by certain
-# version of zlib which CURL depends on.
+# See https://cmake.org/cmake/help/latest/policy/CMP0074.html required by
+# certain version of zlib which CURL depends on.
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12")
cmake_policy(SET CMP0074 NEW)
endif()
+# Allow to use normal variable for option()
+if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13")
+ cmake_policy(SET CMP0077 NEW)
+endif()
+
# Prefer CMAKE_MSVC_RUNTIME_LIBRARY if possible
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
+if(POLICY CMP0092)
+ # https://cmake.org/cmake/help/latest/policy/CMP0092.html#policy:CMP0092 Make
+ # sure the /W3 is not removed from CMAKE_CXX_FLAGS since CMake 3.15
+ cmake_policy(SET CMP0092 OLD)
+endif()
+
+# MSVC RTTI flag /GR should not be not added to CMAKE_CXX_FLAGS by default. @see
+# https://cmake.org/cmake/help/latest/policy/CMP0117.html
+if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.20.0")
+ cmake_policy(SET CMP0117 NEW)
+endif()
+
project(opentelemetry-cpp)
# Mark variables as used so cmake doesn't complain about them
mark_as_advanced(CMAKE_TOOLCHAIN_FILE)
-# Prefer cmake CONFIG to auto resolve dependencies.
-set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
-
# Don't use customized cmake modules if vcpkg is used to resolve dependence.
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")
endif()
-if(EXISTS "${CMAKE_SOURCE_DIR}/third_party_release")
- file(STRINGS "${CMAKE_SOURCE_DIR}/third_party_release" third_party_tags)
- foreach(third_party ${third_party_tags})
- string(REGEX REPLACE "^[ ]+" "" third_party ${third_party})
- string(REGEX MATCH "^[^=]+" third_party_name ${third_party})
- string(REPLACE "${third_party_name}=" "" third_party_tag ${third_party})
- set(${third_party_name} "${third_party_tag}")
- endforeach()
-endif()
-
-if(DEFINED ENV{ARCH})
- # Architecture may be specified via ARCH environment variable
- set(ARCH $ENV{ARCH})
-else()
- # Autodetection logic that populates ARCH variable
- if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
- # Windows may report AMD64 even if target is 32-bit
- if(CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(ARCH x64)
- elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
- set(ARCH x86)
+# Set the third-party release git tags.
+if(EXISTS "${opentelemetry-cpp_SOURCE_DIR}/third_party_release")
+ file(STRINGS "${opentelemetry-cpp_SOURCE_DIR}/third_party_release"
+ third_party_tags)
+ foreach(_raw_line IN LISTS third_party_tags)
+ # Strip leading/trailing whitespace
+ string(STRIP "${_raw_line}" _line)
+ # Skip empty lines and comments
+ if(_line STREQUAL "" OR _line MATCHES "^#")
+ continue()
endif()
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*")
- # Windows may report x86 even if target is 64-bit
- if(CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(ARCH x64)
- elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
- set(ARCH x86)
+
+ # Match "package_name=git_tag"
+ if(_line MATCHES "^([^=]+)=(.+)$")
+ set(_third_party_name "${CMAKE_MATCH_1}")
+ set(_git_tag "${CMAKE_MATCH_2}")
+ set("${_third_party_name}_GIT_TAG" "${_git_tag}")
+ else()
+ message(
+ FATAL_ERROR
+ "Could not parse third-party tag. Invalid line in ${opentelemetry-cpp_SOURCE_DIR}/third_party_release. Line:\n ${_raw_line}"
+ )
endif()
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES
- "^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)")
- set(ARCH arm64)
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm.*|ARM.*)")
- set(ARCH arm)
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64le")
- set(ARCH ppc64le)
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
- set(ARCH ppc64)
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(mips.*|MIPS.*)")
- set(ARCH mips)
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(riscv.*|RISCV.*)")
- set(ARCH riscv)
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(s390x.*|S390X.*)")
- set(ARCH s390x)
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(sparc.*|SPARC.*)")
- set(ARCH sparc)
- else()
- message(
- FATAL_ERROR
- "opentelemetry-cpp: unrecognized target processor ${CMAKE_SYSTEM_PROCESSOR} configuration!"
- )
- endif()
+ endforeach()
endif()
-message(STATUS "Building for architecture ARCH=${ARCH}")
# Autodetect vcpkg toolchain
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
@@ -93,10 +74,6 @@ if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
CACHE STRING "")
endif()
-if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
- include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}")
-endif()
-
option(WITH_ABI_VERSION_1 "ABI version 1" ON)
option(WITH_ABI_VERSION_2 "EXPERIMENTAL: ABI version 2 preview" OFF)
@@ -159,14 +136,6 @@ message(STATUS "OPENTELEMETRY_VERSION=${OPENTELEMETRY_VERSION}")
option(WITH_NO_DEPRECATED_CODE "Do not include deprecated code" OFF)
-# This option is temporary, and will be removed. Set
-# WITH_DEPRECATED_SDK_FACTORY=OFF to migrate to the new SDK code.
-option(WITH_DEPRECATED_SDK_FACTORY "Use deprecated SDK provider factory" ON)
-
-if(WITH_DEPRECATED_SDK_FACTORY)
- message(WARNING "WITH_DEPRECATED_SDK_FACTORY=ON is temporary and deprecated")
-endif()
-
set(WITH_STL
"OFF"
CACHE STRING "Which version of the Standard Library for C++ to use")
@@ -174,8 +143,6 @@ set(WITH_STL
option(WITH_GSL
"Whether to use Guidelines Support Library for C++ latest features" OFF)
-option(WITH_ABSEIL "Whether to use Abseil for C++latest features" OFF)
-
set(OPENTELEMETRY_INSTALL_default ON)
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(OPENTELEMETRY_INSTALL_default OFF)
@@ -183,7 +150,7 @@ endif()
option(OPENTELEMETRY_INSTALL "Whether to install opentelemetry targets"
${OPENTELEMETRY_INSTALL_default})
-include("${PROJECT_SOURCE_DIR}/cmake/tools.cmake")
+include("${opentelemetry-cpp_SOURCE_DIR}/cmake/tools.cmake")
if(NOT WITH_STL STREQUAL "OFF")
# These definitions are needed for test projects that do not link against
@@ -204,15 +171,14 @@ if(NOT WITH_STL STREQUAL "OFF")
endif()
endif()
-if(DEFINED WITH_OTLP)
- message(
- FATAL_ERROR
- "WITH_OTLP is deprecated. Please set either WITH_OTLP_GRPC=ON, WITH_OTLP_HTTP=ON, or both to ON."
- )
-endif()
+option(WITH_OTLP_RETRY_PREVIEW
+ "Whether to enable experimental retry functionality" OFF)
option(WITH_OTLP_GRPC_SSL_MTLS_PREVIEW
- "Whether to enable mTLS support fro gRPC" OFF)
+ "Whether to enable mTLS support for gRPC" OFF)
+
+option(WITH_OTLP_GRPC_CREDENTIAL_PREVIEW
+ "Whether to enable gRPC credentials option in OTLP gRPC Exporter" OFF)
option(WITH_OTLP_GRPC "Whether to include the OTLP gRPC exporter in the SDK"
OFF)
@@ -228,6 +194,9 @@ option(
"Whether to include gzip compression for the OTLP http exporter in the SDK"
OFF)
+option(WITH_CURL_LOGGING "Whether to enable select CURL verbosity in OTel logs"
+ OFF)
+
option(WITH_ZIPKIN "Whether to include the Zipkin exporter in the SDK" OFF)
option(WITH_PROMETHEUS "Whether to include the Prometheus Client in the SDK"
@@ -251,22 +220,10 @@ option(WITH_OPENTRACING "Whether to include the Opentracing shim" OFF)
option(OTELCPP_VERSIONED_LIBS "Whether to generate the versioned shared libs"
OFF)
-#
-# This option is experimental, subject to change in the spec:
-#
-# * https://github.com/open-telemetry/opentelemetry-specification/issues/2232
-#
-option(WITH_REMOVE_METER_PREVIEW
- "EXPERIMENTAL, ABI BREAKING: Allow to remove a meter" OFF)
-
if(OTELCPP_VERSIONED_LIBS AND NOT BUILD_SHARED_LIBS)
message(FATAL_ERROR "OTELCPP_VERSIONED_LIBS=ON requires BUILD_SHARED_LIBS=ON")
endif()
-set(OTELCPP_PROTO_PATH
- ""
- CACHE PATH "Path to opentelemetry-proto")
-
if(WIN32)
option(WITH_ETW "Whether to include the ETW Exporter in the SDK" ON)
else()
@@ -294,46 +251,38 @@ option(
option(WITH_FUNC_TESTS "Whether to build functional tests" ON)
-if(DEFINED WITH_LOGS_PREVIEW)
- message(WARNING "WITH_LOGS_PREVIEW is removed because logs signal is stable")
-endif()
-
option(WITH_ASYNC_EXPORT_PREVIEW "Whether to enable async export" OFF)
# Exemplar specs status is experimental, so behind feature flag by default
option(WITH_METRICS_EXEMPLAR_PREVIEW
"Whether to enable exemplar within metrics" OFF)
+# Experimental, so behind feature flag by default
+option(WITH_THREAD_INSTRUMENTATION_PREVIEW
+ "Whether to enable thread instrumentation" OFF)
+
+option(WITH_RESOURCE_DETECTORS_PREVIEW
+ "Whether to enable inbuilt resource detectors" OFF)
+
+option(OPENTELEMETRY_SKIP_DYNAMIC_LOADING_TESTS
+ "Whether to build test libraries that are always linked as shared libs"
+ OFF)
+
#
# Verify options dependencies
#
+include(FetchContent)
+
if(WITH_EXAMPLES_HTTP AND NOT WITH_EXAMPLES)
message(FATAL_ERROR "WITH_EXAMPLES_HTTP=ON requires WITH_EXAMPLES=ON")
endif()
-find_package(Threads)
-
-function(install_windows_deps)
- # Bootstrap vcpkg from CMake and auto-install deps in case if we are missing
- # deps on Windows. Respect the target architecture variable.
- set(VCPKG_TARGET_ARCHITECTURE
- ${ARCH}
- PARENT_SCOPE)
- message(STATUS "Installing build tools and dependencies...")
- set(ENV{ARCH} ${ARCH})
- execute_process(
- COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tools/setup-buildtools.cmd)
- set(CMAKE_TOOLCHAIN_FILE
- ${CMAKE_CURRENT_SOURCE_DIR}/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
- CACHE FILEPATH "")
- message(
- STATUS
- "Make sure that vcpkg.cmake is set as the CMAKE_TOOLCHAIN_FILE at the START of the cmake build process!
- Can be command-line arg (cmake -DCMAKE_TOOLCHAIN_FILE=...) or set in your editor of choice."
- )
+if(WITH_GSL)
+ include("${opentelemetry-cpp_SOURCE_DIR}/cmake/ms-gsl.cmake")
+endif()
-endfunction()
+find_package(Threads)
function(set_target_version target_name)
if(OTELCPP_VERSIONED_LIBS)
@@ -358,95 +307,6 @@ endif()
# GNUInstallDirs.
include(GNUInstallDirs)
-if(WITH_PROMETHEUS)
- find_package(prometheus-cpp CONFIG QUIET)
- if(NOT prometheus-cpp_FOUND)
- message(STATUS "Trying to use local prometheus-cpp from submodule")
- if(EXISTS ${PROJECT_SOURCE_DIR}/third_party/prometheus-cpp/.git)
- set(SAVED_ENABLE_TESTING ${ENABLE_TESTING})
- set(ENABLE_TESTING OFF)
- add_subdirectory(third_party/prometheus-cpp)
- set(ENABLE_TESTING ${SAVED_ENABLE_TESTING})
- else()
- message(
- FATAL_ERROR
- "\nprometheus-cpp package was not found. Please either provide it manually or clone with submodules. "
- "To initialize, fetch and checkout any nested submodules, you can use the following command:\n"
- "git submodule update --init --recursive")
- endif()
- else()
- message(STATUS "Using external prometheus-cpp")
- endif()
-endif()
-
-if(WITH_ABSEIL)
- if(NOT TARGET absl::strings)
- find_package(absl CONFIG REQUIRED)
- endif()
-endif()
-
-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()
-
- if(WITH_OTLP_GRPC)
- find_package(gRPC)
- endif()
- if((NOT Protobuf_FOUND AND NOT PROTOBUF_FOUND) OR (NOT gRPC_FOUND))
- if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE))
- install_windows_deps()
- endif()
-
- if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE))
- message(FATAL_ERROR "Windows dependency installation failed!")
- endif()
- if(WIN32)
- include(${CMAKE_TOOLCHAIN_FILE})
- endif()
-
- if(NOT Protobuf_FOUND AND NOT PROTOBUF_FOUND)
- find_package(Protobuf REQUIRED)
- endif()
- if(NOT gRPC_FOUND AND WITH_OTLP_GRPC)
- find_package(gRPC)
- endif()
- if(WIN32)
- # Always use x64 protoc.exe
- if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
- set(Protobuf_PROTOC_EXECUTABLE
- ${CMAKE_CURRENT_SOURCE_DIR}/tools/vcpkg/packages/protobuf_x64-windows/tools/protobuf/protoc.exe
- )
- endif()
- endif()
- endif()
- # Latest Protobuf imported targets and without legacy module support
- if(TARGET protobuf::protoc)
- project_build_tools_get_imported_location(PROTOBUF_PROTOC_EXECUTABLE
- protobuf::protoc)
- # If protobuf::protoc is not a imported target, then we use the target
- # directly for fallback
- if(NOT PROTOBUF_PROTOC_EXECUTABLE)
- set(PROTOBUF_PROTOC_EXECUTABLE protobuf::protoc)
- endif()
- elseif(Protobuf_PROTOC_EXECUTABLE)
- # Some versions of FindProtobuf.cmake uses mixed case instead of uppercase
- set(PROTOBUF_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE})
- endif()
- include(CMakeDependentOption)
-
- message(STATUS "PROTOBUF_PROTOC_EXECUTABLE=${PROTOBUF_PROTOC_EXECUTABLE}")
- include(cmake/opentelemetry-proto.cmake)
-endif()
-
#
# Do we need HTTP CLIENT CURL ?
#
@@ -461,26 +321,49 @@ else()
set(WITH_HTTP_CLIENT_CURL OFF)
endif()
+#
+# Do we need ZLIB ?
+#
+
+if((NOT WITH_API_ONLY)
+ AND WITH_HTTP_CLIENT_CURL
+ AND WITH_OTLP_HTTP_COMPRESSION)
+ include("${opentelemetry-cpp_SOURCE_DIR}/cmake/zlib.cmake")
+endif()
+
#
# Do we need CURL ?
#
if((NOT WITH_API_ONLY) AND WITH_HTTP_CLIENT_CURL)
- # No specific version required.
- find_package(CURL REQUIRED)
- message(STATUS "Found CURL: ${CURL_LIBRARIES}, version ${CURL_VERSION}")
+ include("${opentelemetry-cpp_SOURCE_DIR}/cmake/curl.cmake")
endif()
#
-# Do we need ZLIB ?
+# Do we need prometheus-cpp ?
#
-if((NOT WITH_API_ONLY)
- AND WITH_HTTP_CLIENT_CURL
- AND WITH_OTLP_HTTP_COMPRESSION)
- # No specific version required.
- find_package(ZLIB REQUIRED)
- message(STATUS "Found ZLIB: ${ZLIB_LIBRARIES}, version ${ZLIB_VERSION}")
+if(WITH_PROMETHEUS)
+ include("${opentelemetry-cpp_SOURCE_DIR}/cmake/prometheus-cpp.cmake")
+endif()
+
+#
+# Do we need protobuf and/or gRPC ?
+#
+
+if(WITH_OTLP_GRPC
+ OR WITH_OTLP_HTTP
+ OR WITH_OTLP_FILE)
+
+ # find or fetch grpc before protobuf to allow protobuf to be built in-tree as
+ # a grpc submodule.
+ if(WITH_OTLP_GRPC)
+ include("${opentelemetry-cpp_SOURCE_DIR}/cmake/grpc.cmake")
+ endif()
+
+ include("${opentelemetry-cpp_SOURCE_DIR}/cmake/protobuf.cmake")
+
+ include("${opentelemetry-cpp_SOURCE_DIR}/cmake/opentelemetry-proto.cmake")
endif()
#
@@ -499,7 +382,15 @@ else()
endif()
if((NOT WITH_API_ONLY) AND USE_NLOHMANN_JSON)
- include(cmake/nlohmann-json.cmake)
+ include("${opentelemetry-cpp_SOURCE_DIR}/cmake/nlohmann-json.cmake")
+endif()
+
+#
+# Do we need OpenTracing ?
+#
+
+if(WITH_OPENTRACING)
+ include("${opentelemetry-cpp_SOURCE_DIR}/cmake/opentracing-cpp.cmake")
endif()
if(OTELCPP_MAINTAINER_MODE)
@@ -580,6 +471,7 @@ if(OTELCPP_MAINTAINER_MODE)
add_compile_options(/wd4127)
add_compile_options(/wd4512)
add_compile_options(/wd4267)
+ add_compile_options(/wd4996)
# Enforced warnings
add_compile_options(/we4265) # 'class': class has virtual functions, but
@@ -596,57 +488,138 @@ list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}")
include(CTest)
if(BUILD_TESTING)
- if(EXISTS ${CMAKE_BINARY_DIR}/lib/libgtest.a)
- # Prefer GTest from build tree. GTest is not always working with
- # CMAKE_PREFIX_PATH
- set(GTEST_INCLUDE_DIRS
- ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/include
- ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googlemock/include)
- if(TARGET gtest)
- set(GTEST_BOTH_LIBRARIES gtest gtest_main)
- else()
- set(GTEST_BOTH_LIBRARIES ${CMAKE_BINARY_DIR}/lib/libgtest.a
- ${CMAKE_BINARY_DIR}/lib/libgtest_main.a)
- endif()
- elseif(WIN32)
- # Make sure we are always bootsrapped with vcpkg on Windows
- find_package(GTest)
- if(NOT (GTEST_FOUND OR GTest_FOUND))
- if(DEFINED CMAKE_TOOLCHAIN_FILE)
- message(
- FATAL_ERROR
- "Pleaes install GTest with the CMAKE_TOOLCHAIN_FILE at ${CMAKE_TOOLCHAIN_FILE}"
- )
- else()
- install_windows_deps()
- include(${CMAKE_TOOLCHAIN_FILE})
- find_package(GTest REQUIRED)
- endif()
- endif()
- else()
- # Prefer GTest installed by OS distro, brew or vcpkg package manager
- find_package(GTest REQUIRED)
- endif()
- if(NOT GTEST_BOTH_LIBRARIES)
- # New GTest package names
- if(TARGET GTest::gtest)
- set(GTEST_BOTH_LIBRARIES GTest::gtest GTest::gtest_main)
- elseif(TARGET GTest::GTest)
- set(GTEST_BOTH_LIBRARIES GTest::GTest GTest::Main)
- endif()
- endif()
- if(GTEST_INCLUDE_DIRS)
- include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
- endif()
- message(STATUS "GTEST_INCLUDE_DIRS = ${GTEST_INCLUDE_DIRS}")
- message(STATUS "GTEST_BOTH_LIBRARIES = ${GTEST_BOTH_LIBRARIES}")
+ include("${opentelemetry-cpp_SOURCE_DIR}/cmake/googletest.cmake")
enable_testing()
if(WITH_BENCHMARK)
- # Benchmark respects the CMAKE_PREFIX_PATH
- find_package(benchmark CONFIG REQUIRED)
+ include("${opentelemetry-cpp_SOURCE_DIR}/cmake/benchmark.cmake")
endif()
endif()
+# Record build config and versions
+message(STATUS "---------------------------------------------")
+message(STATUS "build settings")
+message(STATUS "---------------------------------------------")
+message(STATUS "OpenTelemetry: ${OPENTELEMETRY_VERSION}")
+message(STATUS "OpenTelemetry ABI: ${OPENTELEMETRY_ABI_VERSION_NO}")
+message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
+message(STATUS "CXX: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
+message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+message(STATUS "CXXFLAGS: ${CMAKE_CXX_FLAGS}")
+message(STATUS "CMAKE_CXX_STANDARD: ${CMAKE_CXX_STANDARD}")
+message(STATUS "CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}")
+message(STATUS "BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
+
+message(STATUS "---------------------------------------------")
+message(STATUS "opentelemetry-cpp build options")
+message(STATUS "---------------------------------------------")
+message(STATUS "WITH_API_ONLY: ${WITH_API_ONLY}")
+message(STATUS "WITH_NO_DEPRECATED_CODE: ${WITH_NO_DEPRECATED_CODE}")
+message(STATUS "WITH_ABI_VERSION_1: ${WITH_ABI_VERSION_1}")
+message(STATUS "WITH_ABI_VERSION_2: ${WITH_ABI_VERSION_2}")
+message(STATUS "OTELCPP_VERSIONED_LIBS: ${OTELCPP_VERSIONED_LIBS}")
+message(STATUS "OTELCPP_MAINTAINER_MODE: ${OTELCPP_MAINTAINER_MODE}")
+message(STATUS "WITH_STL: ${WITH_STL}")
+message(STATUS "WITH_GSL: ${WITH_GSL}")
+message(STATUS "WITH_NO_GETENV: ${WITH_NO_GETENV}")
+
+message(STATUS "---------------------------------------------")
+message(STATUS "opentelemetry-cpp cmake component options")
+message(STATUS "---------------------------------------------")
+message(STATUS "WITH_OTLP_GRPC: ${WITH_OTLP_GRPC}")
+message(STATUS "WITH_OTLP_HTTP: ${WITH_OTLP_HTTP}")
+message(STATUS "WITH_OTLP_FILE: ${WITH_OTLP_FILE}")
+message(STATUS "WITH_HTTP_CLIENT_CURL: ${WITH_HTTP_CLIENT_CURL}")
+message(STATUS "WITH_ZIPKIN: ${WITH_ZIPKIN}")
+message(STATUS "WITH_PROMETHEUS: ${WITH_PROMETHEUS}")
+message(STATUS "WITH_ELASTICSEARCH: ${WITH_ELASTICSEARCH}")
+message(STATUS "WITH_OPENTRACING: ${WITH_OPENTRACING}")
+message(STATUS "WITH_ETW: ${WITH_ETW}")
+message(STATUS "OPENTELEMETRY_BUILD_DLL: ${OPENTELEMETRY_BUILD_DLL}")
+
+message(STATUS "---------------------------------------------")
+message(STATUS "feature preview options")
+message(STATUS "---------------------------------------------")
+message(STATUS "WITH_ASYNC_EXPORT_PREVIEW: ${WITH_ASYNC_EXPORT_PREVIEW}")
+message(
+ STATUS
+ "WITH_THREAD_INSTRUMENTATION_PREVIEW: ${WITH_THREAD_INSTRUMENTATION_PREVIEW}"
+)
+message(
+ STATUS "WITH_METRICS_EXEMPLAR_PREVIEW: ${WITH_METRICS_EXEMPLAR_PREVIEW}")
+message(
+ STATUS "WITH_OTLP_GRPC_SSL_MTLS_PREVIEW: ${WITH_OTLP_GRPC_SSL_MTLS_PREVIEW}")
+message(
+ STATUS
+ "WITH_OTLP_GRPC_CREDENTIAL_PREVIEW: ${WITH_OTLP_GRPC_CREDENTIAL_PREVIEW}")
+message(STATUS "WITH_OTLP_RETRY_PREVIEW: ${WITH_OTLP_RETRY_PREVIEW}")
+message(STATUS "---------------------------------------------")
+message(STATUS "third-party options")
+message(STATUS "---------------------------------------------")
+message(STATUS "WITH_NLOHMANN_JSON: ${USE_NLOHMANN_JSON}")
+message(STATUS "WITH_CURL_LOGGING: ${WITH_CURL_LOGGING}")
+message(STATUS "WITH_OTLP_HTTP_COMPRESSION: ${WITH_OTLP_HTTP_COMPRESSION}")
+message(STATUS "---------------------------------------------")
+message(STATUS "examples and test options")
+message(STATUS "---------------------------------------------")
+message(STATUS "WITH_BENCHMARK: ${WITH_BENCHMARK}")
+message(STATUS "WITH_EXAMPLES: ${WITH_EXAMPLES}")
+message(STATUS "WITH_EXAMPLES_HTTP: ${WITH_EXAMPLES_HTTP}")
+message(STATUS "WITH_FUNC_TESTS: ${WITH_FUNC_TESTS}")
+message(STATUS "BUILD_W3CTRACECONTEXT_TEST: ${BUILD_W3CTRACECONTEXT_TEST}")
+message(STATUS "BUILD_TESTING: ${BUILD_TESTING}")
+message(STATUS "---------------------------------------------")
+message(STATUS "versions")
+message(STATUS "---------------------------------------------")
+message(STATUS "CMake: ${CMAKE_VERSION}")
+message(STATUS "GTest: ${GTest_VERSION} (${GTest_PROVIDER})")
+message(STATUS "benchmark: ${benchmark_VERSION} (${benchmark_PROVIDER})")
+if(WITH_GSL)
+ message(
+ STATUS "Microsoft.GSL: ${Microsoft.GSL_VERSION} (${Microsoft.GSL_PROVIDER})"
+ )
+endif()
+if(absl_FOUND)
+ message(STATUS "Abseil: ${absl_VERSION}")
+endif()
+if(opentelemetry-proto_VERSION)
+ message(
+ STATUS
+ "opentelemetry-proto: ${opentelemetry-proto_VERSION} (${opentelemetry-proto_PROVIDER})"
+ )
+endif()
+if(Protobuf_VERSION)
+ message(
+ STATUS
+ "Protobuf: ${Protobuf_VERSION} (${Protobuf_PROVIDER} - ${protobuf_lib_type})"
+ )
+endif()
+if(gRPC_VERSION)
+ message(STATUS "gRPC: ${gRPC_VERSION} (${gRPC_PROVIDER} - ${grpc_lib_type})")
+endif()
+if(CURL_VERSION)
+ message(STATUS "CURL: ${CURL_VERSION} (${CURL_PROVIDER})")
+endif()
+if(ZLIB_VERSION)
+ message(STATUS "ZLIB: ${ZLIB_VERSION} (${ZLIB_PROVIDER})")
+endif()
+if(USE_NLOHMANN_JSON)
+ message(
+ STATUS "nlohmann-json: ${nlohmann_json_VERSION} (${nlohmann_json_PROVIDER})"
+ )
+endif()
+if(WITH_PROMETHEUS)
+ message(
+ STATUS
+ "prometheus-cpp: ${prometheus-cpp_VERSION} (${prometheus-cpp_PROVIDER})")
+endif()
+if(WITH_OPENTRACING)
+ message(
+ STATUS "opentracing-cpp: ${OpenTracing_VERSION} (${OpenTracing_PROVIDER})")
+endif()
+message(STATUS "---------------------------------------------")
+
+include("${opentelemetry-cpp_SOURCE_DIR}/cmake/otel-install-functions.cmake")
+
include(CMakePackageConfigHelpers)
if(DEFINED OPENTELEMETRY_BUILD_DLL)
@@ -663,42 +636,21 @@ if(DEFINED OPENTELEMETRY_BUILD_DLL)
add_definitions(-DOPENTELEMETRY_BUILD_EXPORT_DLL)
endif()
-include_directories(api/include)
-
add_subdirectory(api)
if(WITH_OPENTRACING)
- find_package(OpenTracing CONFIG QUIET)
- if(NOT OpenTracing_FOUND)
- set(OPENTRACING_DIR "third_party/opentracing-cpp")
- message(STATUS "Trying to use local ${OPENTRACING_DIR} from submodule")
- if(EXISTS "${PROJECT_SOURCE_DIR}/${OPENTRACING_DIR}/.git")
- set(SAVED_BUILD_TESTING ${BUILD_TESTING})
- set(BUILD_TESTING OFF)
- add_subdirectory(${OPENTRACING_DIR})
- set(BUILD_TESTING ${SAVED_BUILD_TESTING})
- else()
- message(
- FATAL_ERROR
- "\nopentracing-cpp package was not found. Please either provide it manually or clone with submodules. "
- "To initialize, fetch and checkout any nested submodules, you can use the following command:\n"
- "git submodule update --init --recursive")
- endif()
- else()
- message(STATUS "Using external opentracing-cpp")
- endif()
add_subdirectory(opentracing-shim)
endif()
if(NOT WITH_API_ONLY)
set(BUILD_TESTING ${BUILD_TESTING})
- include_directories(sdk/include)
- include_directories(sdk)
- include_directories(ext/include)
add_subdirectory(sdk)
add_subdirectory(ext)
add_subdirectory(exporters)
+ if(WITH_RESOURCE_DETECTORS_PREVIEW)
+ add_subdirectory(resource_detectors)
+ endif()
if(BUILD_TESTING)
add_subdirectory(test_common)
@@ -711,46 +663,23 @@ if(NOT WITH_API_ONLY)
endif()
endif()
-include(cmake/opentelemetry-build-external-component.cmake)
-include(cmake/patch-imported-config.cmake)
+include(
+ "${opentelemetry-cpp_SOURCE_DIR}/cmake/opentelemetry-build-external-component.cmake"
+)
+include("${opentelemetry-cpp_SOURCE_DIR}/cmake/patch-imported-config.cmake")
if(OPENTELEMETRY_INSTALL)
- # Export cmake config and support find_packages(opentelemetry-cpp CONFIG)
- # Write config file for find_packages(opentelemetry-cpp CONFIG)
- set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}")
- configure_package_config_file(
- "${CMAKE_CURRENT_LIST_DIR}/cmake/opentelemetry-cpp-config.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}/${PROJECT_NAME}-config.cmake"
- INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
- PATH_VARS OPENTELEMETRY_ABI_VERSION_NO OPENTELEMETRY_VERSION PROJECT_NAME
- INCLUDE_INSTALL_DIR CMAKE_INSTALL_LIBDIR
- NO_CHECK_REQUIRED_COMPONENTS_MACRO)
-
- # Write version file for find_packages(opentelemetry-cpp CONFIG)
- write_basic_package_version_file(
- "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}/${PROJECT_NAME}-config-version.cmake"
- VERSION ${OPENTELEMETRY_VERSION}
- COMPATIBILITY ExactVersion)
-
- install(
- FILES
- "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}/${PROJECT_NAME}-config.cmake"
- "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}/${PROJECT_NAME}-config-version.cmake"
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
-
- # Export all components
- export(
- EXPORT "${PROJECT_NAME}-target"
- NAMESPACE "${PROJECT_NAME}::"
- FILE "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}/${PROJECT_NAME}-target.cmake"
- )
- install(
- EXPORT "${PROJECT_NAME}-target"
- NAMESPACE "${PROJECT_NAME}::"
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
+ # Install the cmake config and version files
+ otel_install_cmake_config()
+
+ # Install the components and associated files
+ otel_install_components()
+
+ # Install the thirdparty dependency definition file
+ otel_install_thirdparty_definitions()
if(BUILD_PACKAGE)
- include(cmake/package.cmake)
+ include("${opentelemetry-cpp_SOURCE_DIR}/cmake/package.cmake")
include(CPack)
endif()
endif()
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 95b4e226f8..fda99e0978 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -60,6 +60,121 @@ bazel build //examples/simple:example_simple
bazel-bin/examples/simple/example_simple
```
+### DevContainer Setup for Project
+
+This guide provides instructions on how to set up and use the development
+container (`devcontainer`) environment to streamline testing and development
+for this project. With the DevContainer, you can work in a consistent environment
+configured with all the necessary dependencies and tools.
+
+#### Prerequisites
+
+Before getting started, ensure you have the following installed:
+
+* **Docker**: DevContainers require Docker for containerization.
+* **Visual Studio Code (VSCode)** with the **Remote - Containers** extension.
+
+#### Getting Started
+
+* **Open the Project in DevContainer**:
+
+ Open the project in VSCode. When prompted to "Reopen in Container," select
+ this option. If you’re not prompted, you can manually open the container by
+ selecting **Remote-Containers: Reopen in Container** from the command palette
+ (`F1` or `Ctrl+Shift+P`).
+
+* **Container Setup**:
+
+ The DevContainer environment will automatically build based on the configuration
+ files provided (e.g., `.devcontainer/devcontainer.json`). This setup will install
+ required dependencies, tools, and environment variables needed for the project.
+
+* **Container Customization**:
+ See `.devcontainer/README.md` for devcontainer configuration options.
+
+#### Available Commands
+
+Once inside the DevContainer, you can use the following commands to run tests
+and CI workflows.
+
+##### 1. Run Tests with Bazelisk
+
+To run tests with Bazelisk using specific compilation options, use:
+
+```bash
+bazelisk-linux-amd64 test --copt=-DENABLE_LOGS_PREVIEW
+--test_output=errors --cache_test_results=no --copt=-DENABLE_TEST //exporters/otlp/...
+```
+
+###### Command Breakdown
+
+* `--copt=-DENABLE_LOGS_PREVIEW`: Enables preview logs.
+* `--test_output=errors`: Shows only the errors in the test output.
+* `--cache_test_results=no`: Forces Bazel to re-run tests without caching.
+* `--copt=-DENABLE_TEST`: Enables testing capabilities for the target code.
+* `//exporters/otlp/...`: Specifies the test target path.
+
+##### 2. Run CI Script
+
+You can also run the CI script provided to perform testing with the
+following command as an
+example:
+
+```bash
+bash ci/do_ci.sh cmake.exporter.otprotocol.test
+```
+
+This command initiates the CI pipeline, executing tests specifically for the
+**cmake.exporter.otprotocol** module.
+
+#### Troubleshooting
+
+If you encounter issues:
+
+* **Rebuild the DevContainer**: From the command palette, run
+ **Remote-Containers: Rebuild Container** to reinitialize the environment.
+* **Check Bazelisk and CI Script Logs**: Inspect logs for any configuration or
+ dependency issues.
+
+#### Additional Notes
+
+* You can adjust compiler options (`--copt`) as needed to test additional flags
+ or enable/disable specific features.
+* The test results will be displayed in the terminal within the DevContainer for
+ easy debugging.
+
+#### Resources
+
+* **Bazelisk Documentation**: [https://github.com/bazelbuild/bazelisk](https://github.com/bazelbuild/bazelisk)
+* **VSCode DevContainer Documentation**: [https://code.visualstudio.com/docs/remote/containers](https://code.visualstudio.com/docs/remote/containers)
+
+### Docker Development Image
+
+The `.devcontainer/Dockerfile.dev`
+dockerfile can be built directly with the following command.
+
+```sh
+ docker build -t opentelemetry-cpp-dev -f ./.devcontainer/Dockerfile.dev .
+```
+
+You can customize the image using build arguments
+ to match permissions with the host user.
+
+```sh
+ docker build -t opentelemetry-cpp-dev \
+ --build-arg USER_UID="$(id -u)" \
+ --build-arg USER_GID="$(id -g)" \
+ -f ./.devcontainer/Dockerfile.dev .
+
+```
+
+Run an interactive bash session binding your host
+ opentelemetry-cpp directory to the container's workspace:
+
+```sh
+docker run -it -v "$PWD:/workspaces/opentelemetry-cpp" opentelemetry-cpp-dev bash
+```
+
## Pull Requests
### How to Send Pull Requests
@@ -110,6 +225,12 @@ If you made changes to the Markdown documents (`*.md` files), install the latest
markdownlint .
```
+If you modified shell scripts (`*.sh` files), install `shellcheck` and run:
+
+```sh
+shellcheck --severity=error .sh
+```
+
Open a pull request against the main `opentelemetry-cpp` repo.
To run tests locally, please read the [CI instructions](ci/README.md).
@@ -186,11 +307,11 @@ the C++ repository.
* [OpenTelemetry
Specification](https://github.com/open-telemetry/opentelemetry-specification)
- * The OpenTelemetry Specification describes the requirements and expectations
- of for all OpenTelemetry implementations.
+* The OpenTelemetry Specification describes the requirements and expectations
+ of for all OpenTelemetry implementations.
* Read through the OpenTelemetry C++ documentation
- * The
+* The
[API](https://opentelemetry-cpp.readthedocs.io/en/latest/api/api.html)
and
[SDK](https://opentelemetry-cpp.readthedocs.io/en/latest/sdk/sdk.html)
diff --git a/DEPRECATED.md b/DEPRECATED.md
index 7db5ba9d93..399d441b3e 100644
--- a/DEPRECATED.md
+++ b/DEPRECATED.md
@@ -46,127 +46,11 @@ N/A
## [opentelemetry-cpp API]
-### Jaeger propagator
-
-#### Announcement (Jaeger)
-
-* Version: 1.8.2
-* Date: 2023-01-31
-* PR: [DEPRECATION] Deprecate the Jaeger exporter
- [#1923](https://github.com/open-telemetry/opentelemetry-cpp/pull/1923)
-
-This PR also listed the Jaeger propagator as deprecated.
-
-#### Motivation (Jaeger)
-
-The Jaeger Exporter is now (July 2023) removed from the OpenTelemetry specification.
-
-The Jaeger Propagator remains, because changing propagation is a longer
-process compared to changing an export format.
-
-New deployments however are encouraged to use a W3C compliant propagator,
-and avoid the Jaeger propagator, which is now deprecated.
-
-#### Scope (Jaeger)
-
-The following are deprecated and planned for removal:
-
-* the API header `opentelemetry/trace/propagation/jaeger.h`, including:
- * the C++ class `JaegerPropagator`
-
-#### Mitigation (Jaeger)
-
-Use a W3C compliant propagator instead.
-
-That is, use class HttpTraceContext and "traceparent" tags.
-
-Do not use class JaegerPropagator and "uber-trace-id" tags.
-
-#### Planned removal (Jaeger)
-
-No date set yet for the Jaeger Propagator.
+N/A
## [opentelemetry-cpp SDK]
-### SDK ProviderFactory cleanup
-
-#### Announcement (SDK ProviderFactory cleanup)
-
-* Version: 1.15.0
-* Date: 2024-06-03
-* PR: [API/SDK] Provider cleanup
- [#2664](https://github.com/open-telemetry/opentelemetry-cpp/pull/2664)
-
-This PR introduces changes to SDK ProviderFactory methods.
-
-#### Motivation (SDK ProviderFactory cleanup)
-
-SDK Factory methods for signal providers, such as:
-
-* opentelemetry::sdk::trace::TracerProviderFactory
-* opentelemetry::sdk::metrics::MeterProviderFactory
-* opentelemetry::sdk::logs::LoggerProviderFactory
-* opentelemetry::sdk::logs::EventLoggerProviderFactory
-
-currently returns a unique pointer on a API class.
-
-This is incorrect, the proper return type should be
-a unique pointer on a SDK class instead.
-
-#### Scope (SDK ProviderFactory cleanup)
-
-All the current Create methods in:
-
-* class opentelemetry::sdk::trace::TracerProviderFactory
-* class opentelemetry::sdk::metrics::MeterProviderFactory
-* class opentelemetry::sdk::logs::LoggerProviderFactory
-* class opentelemetry::sdk::logs::EventLoggerProviderFactory
-
-are marked as deprecated, as they return an API object.
-
-Instead, another set of Create methods is provided,
-with a different return type, an SDK object.
-
-Both sets can not be exposed at the same time,
-as this would cause build breaks,
-so a compilation flag is defined to select which methods to use.
-
-When OPENTELEMETRY_DEPRECATED_SDK_FACTORY is defined,
-the old, deprecated, methods are available.
-
-When OPENTELEMETRY_DEPRECATED_SDK_FACTORY is not defined,
-the new methods are available.
-
-The scope of this deprecation and removal,
-is to remove the flag OPENTELEMETRY_DEPRECATED_SDK_FACTORY itself,
-which implies that only the new set of Create() methods,
-returning an SDK object, are supported.
-
-#### Mitigation (SDK ProviderFactory cleanup)
-
-Build without defining flag OPENTELEMETRY_DEPRECATED_SDK_FACTORY.
-
-Existing code, such as:
-
-```cpp
- std::shared_ptr tracer_provider;
- tracer_provider = opentelemetry::sdk::trace::TracerProviderFactory::Create(...);
-```
-
-should be adjusted to:
-
-```cpp
- std::shared_ptr tracer_provider;
- tracer_provider = opentelemetry::sdk::trace::TracerProviderFactory::Create(...);
-```
-
-#### Planned removal (SDK ProviderFactory cleanup)
-
-Flag OPENTELEMETRY_DEPRECATED_SDK_FACTORY is introduced in release 1.16.0,
-to provide a migration path.
-
-This flag is meant to be temporary, and short lived.
-Expect removal by release 1.17.0
+N/A
## [opentelemetry-cpp Exporter]
@@ -175,3 +59,7 @@ N/A
## [Documentation]
N/A
+
+## Semantic conventions
+
+N/A
diff --git a/INSTALL.md b/INSTALL.md
index b528181aa2..296a61c44b 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -23,7 +23,9 @@ You can link OpenTelemetry C++ SDK with libraries provided in
repository. To install Git, consult the [Set up
Git](https://help.github.com/articles/set-up-git/) guide on GitHub.
- [CMake](https://cmake.org/) for building opentelemetry-cpp API, SDK with their
- unittests. We use CMake version 3.15.2 in our build system. To install CMake,
+ unittests. The minimum CMake version is 3.14.
+ CMake 3.15+ is recommended on Windows due to known CI test failures with 3.14.
+ To install CMake,
consult the [Installing CMake](https://cmake.org/install/) guide.
- [GoogleTest](https://github.com/google/googletest) framework to build and run
the unittests. Refer to
@@ -38,10 +40,30 @@ You can link OpenTelemetry C++ SDK with libraries provided in
[GoogleBenchmark Build
Instructions](https://github.com/google/benchmark#installation).
- Apart from above core requirements, the Exporters and Propagators have their
- build dependencies which are not covered here. E.g, the OTLP Exporter needs
- grpc/protobuf library, the Zipkin exporter needs nlohmann-json and libcurl,
- the ETW exporter needs nlohmann-json to build. This is covered in the build
- instructions for each of these components.
+ build dependencies.
+
+### Building dependencies for the OTLP exporters
+
+The opentelemetry-cpp OTLP exporters depend on Protobuf and gRPC
+ (in the case of the otlp grpc exporters).
+Protobuf (since version 3.22.0) and gRPC depend on Abseil.
+For cmake builds, it is best practice to build and install Abseil
+, Protobuf, and gPRC as independent packages -
+configuring cmake for Protobuf and gRPC to build against
+ the installed packages instead of using their submodule option.
+
+If building and installing Protobuf and gRPC manually with cmake the
+ recommended approach is:
+
+1. Choose the desired tag version of grpc. Find the compatible versions of abseil
+ and protobuf by inspecting the submodules of grpc at that tag.
+2. Build and install the required version of abseil
+3. Build and install the required version of protobuf
+ - Set the cmake option of Protobuf to build against the installed
+ package of Abseil (`protobuf_ABSL_PROVIDER=package`)
+4. Build and install the required version of grpc
+ - Set the cmake option of grpc to build against the installed packages
+ of Abseil and Protobuf (cmake options - `gRPC_ABSL_PROVIDER=package` and `gRPC_PROTOBUF_PROVIDER=package`)
### Building as standalone CMake Project
@@ -129,22 +151,126 @@ You can link OpenTelemetry C++ SDK with libraries provided in
$
```
-### Incorporating into an existing CMake Project
+### Incorporating into an external CMake Project
-To use the library from a CMake project, you can locate it directly with
- `find_package` and use the imported targets from generated package
- configurations. As of now, this will import targets for both API and SDK. In
- future, there may be separate packages for API and SDK which can be installed
- and imported separately according to need.
+There are two approaches to incoporate `opentelemetry-cpp` into
+ an external CMake project:
+
+1. Build and install `opentelemetry-cpp` then use `find_package`
+ to import its targets
+
+ ```cmake
+ # Find all installed components and link all imported targets
+ find_package(opentelemetry-cpp CONFIG REQUIRED)
+ ...
+ target_include_directories(foo PRIVATE ${OPENTELEMETRY_CPP_INCLUDE_DIRS})
+ target_link_libraries(foo PRIVATE ${OPENTELEMETRY_CPP_LIBRARIES})
+ ```
+
+ ```cmake
+ # Find a specific component and link its imported target(s)
+ find_package(opentelemetry-cpp CONFIG REQUIRED COMPONENTS api)
+ ...
+ target_link_libraries(foo PRIVATE opentelemetry-cpp::api)
+ ```
+
+2. Use CMake's [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html)
+ module to fetch and build `opentelemetry-cpp` then make its targets available
+
+ ```cmake
+ # Fetch from an existing clone and build
+ include(FetchContent)
+ FetchContent_Declare(opentelemetry-cpp SOURCE_DIR "")
+ FetchContent_MakeAvailable(opentelemetry-cpp)
+ ...
+ target_link_libraries(foo PRIVATE opentelemetry-cpp::api)
+ ```
+
+ ```cmake
+ # Clone and build opentelemetry-cpp from a git tag
+ include(FetchContent)
+ FetchContent_Declare(
+ opentelemetry-cpp
+ GIT_REPOSITORY https://github.com/open-telemetry/opentelemetry-cpp.git
+ GIT_TAG v1.20.0)
+ FetchContent_MakeAvailable(opentelemetry-cpp)
+ ...
+ target_link_libraries(foo PRIVATE opentelemetry-cpp::api)
+ ```
+
+In both cases the project's built or imported CMake targets will be
+ available in the `opentelemetry-cpp` namespace (ie: `opentelemetry-cpp::api`)
+
+#### Using opentelemetry-cpp package components
+
+> **Note:** `opentelemetry-cpp` CMake package components were introduced in `v1.21.0`
+
+The `opentelemetry-cpp` package supports using the `COMPONENTS` argument to
+`find_package`. The following example illustrates using this feature to include
+and link the `api` header only target to an instrumented `foo_lib` while only including
+and linking the `sdk` and `otlp_grpc_exporter` targets to the `foo_app`.
```cmake
-# CMakeLists.txt
-find_package(opentelemetry-cpp CONFIG REQUIRED)
-...
-target_include_directories(foo PRIVATE ${OPENTELEMETRY_CPP_INCLUDE_DIRS})
-target_link_libraries(foo PRIVATE ${OPENTELEMETRY_CPP_LIBRARIES})
+# foo_lib/CMakeLists.txt
+find_package(opentelemetry-cpp CONFIG REQUIRED COMPONENTS api)
+add_library(foo_lib foo.cpp)
+target_link_libraries(foo_lib PRIVATE opentelemetry-cpp::api)
```
+```cmake
+# foo_app/CMakeLists.txt
+find_package(opentelemetry-cpp CONFIG REQUIRED COMPONENTS api sdk exporters_otlp_grpc)
+add_executable(foo_app main.cpp)
+target_link_libraries(foo_app PRIVATE foo_lib opentelemetry-cpp::api opentelemetry-cpp::trace opentelemetry-cpp::otlp_grpc_exporter )
+```
+
+The following table provides the mapping between components and targets. Components
+and targets available in the installation depends on the opentelemetry-cpp package
+build configuration.
+
+> **Note:** components `exporters_elasticsearch` and `exporters_etw`
+ may be moved out of the core package and to `opentelemetry-cpp-contrib`
+ in a future release
+
+| Component | Targets |
+|----------------------------|--------------------------------------------------------------------------------------------------|
+| **api** | opentelemetry-cpp::api |
+| **sdk** | opentelemetry-cpp::sdk |
+| | opentelemetry-cpp::version |
+| | opentelemetry-cpp::common |
+| | opentelemetry-cpp::resources |
+| | opentelemetry-cpp::trace |
+| | opentelemetry-cpp::metrics |
+| | opentelemetry-cpp::logs |
+| **ext_common** | opentelemetry-cpp::ext |
+| **ext_http_curl** | opentelemetry-cpp::http_client_curl |
+| **ext_dll** | opentelemetry-cpp::opentelemetry_cpp |
+| **exporters_in_memory** | opentelemetry-cpp::in_memory_span_exporter |
+| | opentelemetry-cpp::in_memory_metric_exporter |
+| **exporters_ostream** | opentelemetry-cpp::ostream_log_record_exporter |
+| | opentelemetry-cpp::ostream_metrics_exporter |
+| | opentelemetry-cpp::ostream_span_exporter |
+| **exporters_otlp_common** | opentelemetry-cpp::proto |
+| | opentelemetry-cpp::otlp_recordable |
+| **exporters_otlp_file** | opentelemetry-cpp::otlp_file_client |
+| | opentelemetry-cpp::otlp_file_exporter |
+| | opentelemetry-cpp::otlp_file_log_record_exporter |
+| | opentelemetry-cpp::otlp_file_metric_exporter |
+| **exporters_otlp_grpc** | opentelemetry-cpp::proto_grpc |
+| | opentelemetry-cpp::otlp_grpc_client |
+| | opentelemetry-cpp::otlp_grpc_exporter |
+| | opentelemetry-cpp::otlp_grpc_log_record_exporter |
+| | opentelemetry-cpp::otlp_grpc_metrics_exporter |
+| **exporters_otlp_http** | opentelemetry-cpp::otlp_http_client |
+| | opentelemetry-cpp::otlp_http_exporter |
+| | opentelemetry-cpp::otlp_http_log_record_exporter |
+| | opentelemetry-cpp::otlp_http_metric_exporter |
+| **exporters_prometheus** | opentelemetry-cpp::prometheus_exporter |
+| **exporters_elasticsearch**| opentelemetry-cpp::elasticsearch_log_record_exporter |
+| **exporters_etw** | opentelemetry-cpp::etw_exporter |
+| **exporters_zipkin** | opentelemetry-cpp::zipkin_trace_exporter |
+| **shims_opentracing** | opentelemetry-cpp::opentracing_shim |
+
## Build instructions using Bazel
NOTE: Experimental, and not supported for all the components. Make sure the
diff --git a/MODULE.bazel b/MODULE.bazel
index 7b84c2b719..f0597b59e0 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -3,20 +3,20 @@
module(
name = "opentelemetry-cpp",
- version = "0",
+ version = "1.22.0",
compatibility_level = 0,
repo_name = "io_opentelemetry_cpp",
)
bazel_dep(name = "abseil-cpp", version = "20240116.1", repo_name = "com_google_absl")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
-bazel_dep(name = "curl", version = "8.4.0")
-bazel_dep(name = "grpc", version = "1.62.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.3.1", repo_name = "com_github_opentelemetry_proto")
+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.12.0", repo_name = "github_nlohmann_json")
+bazel_dep(name = "opentelemetry-proto", version = "1.7.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.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")
diff --git a/README.md b/README.md
index 946b8076b1..21e05d6ce3 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,8 @@
[](https://github.com/open-telemetry/opentelemetry-cpp/actions)
[](https://github.com/open-telemetry/opentelemetry-cpp/releases/)
+[](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fopen-telemetry%2Fopentelemetry-cpp?ref=badge_shield&issueType=license)
+[](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fopen-telemetry%2Fopentelemetry-cpp?ref=badge_shield&issueType=security)
The C++ [OpenTelemetry](https://opentelemetry.io/) client.
@@ -82,22 +84,25 @@ doc](https://docs.google.com/document/d/1i1E4-_y4uJ083lCutKGDhkpi3n4_e774SBLi9hP
For edit access, get in touch on
[Slack](https://cloud-native.slack.com/archives/C01N3AT62SJ).
-[Maintainers](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer)
-([@open-telemetry/cpp-maintainers](https://github.com/orgs/open-telemetry/teams/cpp-maintainers)):
+### Maintainers
* [Ehsan Saei](https://github.com/esigo)
* [Lalit Kumar Bhasin](https://github.com/lalitb), Microsoft
* [Marc Alff](https://github.com/marcalff), Oracle
* [Tom Tan](https://github.com/ThomsonTan), Microsoft
-[Approvers](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver)
-([@open-telemetry/cpp-approvers](https://github.com/orgs/open-telemetry/teams/cpp-approvers)):
+For more information about the maintainer role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer).
+### Approvers
+
+* [Doug Barker](https://github.com/dbarker)
* [Josh Suereth](https://github.com/jsuereth), Google
+* [Pranav Sharma](https://github.com/psx95), Google
* [WenTao Ou](https://github.com/owent), Tencent
-[Emeritus
-Maintainer/Approver/Triager](https://github.com/open-telemetry/community/blob/main/community-membership.md#emeritus-maintainerapprovertriager):
+For more information about the approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver).
+
+### Emeritus Maintainer/Approver/Triager
* [Alolita Sharma](https://github.com/alolita)
* [Emil Mikulic](https://github.com/g-easy)
@@ -107,6 +112,8 @@ Maintainer/Approver/Triager](https://github.com/open-telemetry/community/blob/ma
* [Reiley Yang](https://github.com/reyang)
* [Ryan Burn](https://github.com/rnburn)
+For more information about the emeritus role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#emeritus-maintainerapprovertriager).
+
### Thanks to all the people who have contributed
[](https://github.com/open-telemetry/opentelemetry-cpp/graphs/contributors)
diff --git a/RELEASING.md b/RELEASING.md
index 8246e8fe44..852332e820 100644
--- a/RELEASING.md
+++ b/RELEASING.md
@@ -2,7 +2,7 @@
## Pre Release
-1: Upgrade to latest [semantic-conventions](docs/semantic-conventions.md)
+1: Upgrade to latest [dependencies](docs/maintaining-dependencies.md)
if required.
2: Make sure all relevant changes for this release are included under
diff --git a/api/BUILD b/api/BUILD
index fdfe3ca146..fb31393569 100644
--- a/api/BUILD
+++ b/api/BUILD
@@ -1,7 +1,7 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
-load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag")
+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "int_flag", "string_flag")
package(default_visibility = ["//visibility:public"])
@@ -23,7 +23,7 @@ string_flag(
cc_library(
name = "api",
hdrs = glob(["include/**/*.h"]),
- defines = ["HAVE_ABSEIL"] + select({
+ defines = select({
":set_cxx_stdlib_none": [],
### automatic selection
":set_cxx_stdlib_best": ["OPENTELEMETRY_STL_VERSION=(__cplusplus/100)"],
@@ -35,6 +35,9 @@ cc_library(
":set_cxx_stdlib_2020": ["OPENTELEMETRY_STL_VERSION=2020"],
":set_cxx_stdlib_2023": ["OPENTELEMETRY_STL_VERSION=2023"],
"//conditions:default": [],
+ }) + select({
+ ":abi_version_no_1": ["OPENTELEMETRY_ABI_VERSION_NO=1"],
+ ":abi_version_no_2": ["OPENTELEMETRY_ABI_VERSION_NO=2"],
}),
strip_include_prefix = "include",
tags = ["api"],
@@ -61,3 +64,18 @@ bool_flag(
build_setting_default = False,
deprecation = "The value of this flag is ignored. Bazel builds always depend on Abseil for its pre-adopted `std::` types. You should remove this flag from your build command.",
)
+
+int_flag(
+ name = "abi_version_no",
+ build_setting_default = 1,
+)
+
+config_setting(
+ name = "abi_version_no_1",
+ flag_values = {":abi_version_no": "1"},
+)
+
+config_setting(
+ name = "abi_version_no_2",
+ flag_values = {":abi_version_no": "2"},
+)
diff --git a/api/CMakeLists.txt b/api/CMakeLists.txt
index e07275efed..48c9098eaa 100644
--- a/api/CMakeLists.txt
+++ b/api/CMakeLists.txt
@@ -9,22 +9,7 @@ target_include_directories(
set_target_properties(opentelemetry_api PROPERTIES EXPORT_NAME api)
-if(OPENTELEMETRY_INSTALL)
- install(
- TARGETS opentelemetry_api
- EXPORT "${PROJECT_NAME}-target"
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
-
- install(
- DIRECTORY include/opentelemetry
- DESTINATION include
- FILES_MATCHING
- PATTERN "*.h")
-
- unset(TARGET_DEPS)
-endif()
+unset(TARGET_DEPS)
if(BUILD_TESTING)
add_subdirectory(test)
@@ -35,26 +20,6 @@ if(WITH_NO_DEPRECATED_CODE)
INTERFACE OPENTELEMETRY_NO_DEPRECATED_CODE)
endif()
-if(WITH_DEPRECATED_SDK_FACTORY)
- target_compile_definitions(opentelemetry_api
- INTERFACE OPENTELEMETRY_DEPRECATED_SDK_FACTORY)
-endif()
-
-if(WITH_ABSEIL)
- target_compile_definitions(opentelemetry_api INTERFACE HAVE_ABSEIL)
- target_link_libraries(
- opentelemetry_api INTERFACE absl::bad_variant_access absl::any absl::base
- absl::bits absl::city)
- list(
- APPEND
- TARGET_DEPS
- "absl_bad_variant_access"
- "absl_any"
- "absl_base"
- "absl_bits"
- "absl_city")
-endif()
-
if(WITH_STL STREQUAL "OFF")
message(STATUS "Building WITH_STL=OFF")
elseif(WITH_STL STREQUAL "CXX11")
@@ -77,6 +42,10 @@ elseif(WITH_STL STREQUAL "CXX23")
message(STATUS "Building WITH_STL=CXX23")
target_compile_definitions(opentelemetry_api
INTERFACE OPENTELEMETRY_STL_VERSION=2023)
+elseif(WITH_STL STREQUAL "CXX26")
+ message(STATUS "Building WITH_STL=CXX26")
+ target_compile_definitions(opentelemetry_api
+ INTERFACE OPENTELEMETRY_STL_VERSION=2026)
elseif(WITH_STL STREQUAL "ON")
message(STATUS "Building WITH_STL=ON")
# "ON" corresponds to "CXX23" at this time.
@@ -84,23 +53,14 @@ elseif(WITH_STL STREQUAL "ON")
INTERFACE OPENTELEMETRY_STL_VERSION=2023)
else()
message(
- FATAL_ERROR "WITH_STL must be ON, OFF, CXX11, CXX14, CXX17, CXX20 or CXX23")
+ FATAL_ERROR
+ "WITH_STL must be ON, OFF, CXX11, CXX14, CXX17, CXX20, CXX23 or CXX26")
endif()
if(WITH_GSL)
target_compile_definitions(opentelemetry_api INTERFACE HAVE_GSL)
-
- # Guidelines Support Library path. Used if we are not on not get C++20.
- #
- find_package(Microsoft.GSL QUIET)
- if(TARGET Microsoft.GSL::GSL)
- target_link_libraries(opentelemetry_api INTERFACE Microsoft.GSL::GSL)
- list(APPEND TARGET_DEPS "gsl")
- else()
- set(GSL_DIR third_party/ms-gsl)
- target_include_directories(
- opentelemetry_api INTERFACE "$")
- endif()
+ target_link_libraries(opentelemetry_api INTERFACE Microsoft.GSL::GSL)
+ list(APPEND TARGET_DEPS "gsl")
endif()
if(WITH_NO_GETENV)
@@ -121,16 +81,31 @@ target_compile_definitions(
opentelemetry_api
INTERFACE OPENTELEMETRY_ABI_VERSION_NO=${OPENTELEMETRY_ABI_VERSION_NO})
+if(WITH_OTLP_RETRY_PREVIEW)
+ target_compile_definitions(opentelemetry_api
+ INTERFACE ENABLE_OTLP_RETRY_PREVIEW)
+endif()
+
if(WITH_OTLP_GRPC_SSL_MTLS_PREVIEW)
target_compile_definitions(opentelemetry_api
INTERFACE ENABLE_OTLP_GRPC_SSL_MTLS_PREVIEW)
endif()
+if(WITH_OTLP_GRPC_CREDENTIAL_PREVIEW)
+ target_compile_definitions(opentelemetry_api
+ INTERFACE ENABLE_OTLP_GRPC_CREDENTIAL_PREVIEW)
+endif()
+
if(WITH_METRICS_EXEMPLAR_PREVIEW)
target_compile_definitions(opentelemetry_api
INTERFACE ENABLE_METRICS_EXEMPLAR_PREVIEW)
endif()
+if(WITH_THREAD_INSTRUMENTATION_PREVIEW)
+ target_compile_definitions(opentelemetry_api
+ INTERFACE ENABLE_THREAD_INSTRUMENTATION_PREVIEW)
+endif()
+
if(WITH_OTLP_HTTP_COMPRESSION)
target_compile_definitions(opentelemetry_api
INTERFACE ENABLE_OTLP_COMPRESSION_PREVIEW)
@@ -140,6 +115,19 @@ if(APPLE)
target_link_libraries(opentelemetry_api INTERFACE "-framework CoreFoundation")
endif()
+otel_add_component(
+ COMPONENT
+ api
+ TARGETS
+ opentelemetry_api
+ FILES_DIRECTORY
+ "include/opentelemetry"
+ FILES_DESTINATION
+ "include"
+ FILES_MATCHING
+ PATTERN
+ "*.h")
+
include(${PROJECT_SOURCE_DIR}/cmake/pkgconfig.cmake)
if(OPENTELEMETRY_INSTALL)
diff --git a/api/include/opentelemetry/baggage/baggage_context.h b/api/include/opentelemetry/baggage/baggage_context.h
index e5b9556d3f..a0016353ba 100644
--- a/api/include/opentelemetry/baggage/baggage_context.h
+++ b/api/include/opentelemetry/baggage/baggage_context.h
@@ -27,7 +27,7 @@ inline nostd::shared_ptr GetBaggage(const context::Context &context) no
}
inline context::Context SetBaggage(context::Context &context,
- nostd::shared_ptr baggage) noexcept
+ const nostd::shared_ptr &baggage) noexcept
{
return context.SetValue(kBaggageHeader, baggage);
}
diff --git a/api/include/opentelemetry/baggage/propagation/baggage_propagator.h b/api/include/opentelemetry/baggage/propagation/baggage_propagator.h
index 6de32882c0..d75409ed60 100644
--- a/api/include/opentelemetry/baggage/propagation/baggage_propagator.h
+++ b/api/include/opentelemetry/baggage/propagation/baggage_propagator.h
@@ -3,9 +3,15 @@
#pragma once
+#include
+#include
+
#include "opentelemetry/baggage/baggage.h"
#include "opentelemetry/baggage/baggage_context.h"
+#include "opentelemetry/context/context.h"
#include "opentelemetry/context/propagation/text_map_propagator.h"
+#include "opentelemetry/nostd/function_ref.h"
+#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/version.h"
OPENTELEMETRY_BEGIN_NAMESPACE
diff --git a/api/include/opentelemetry/common/attribute_value.h b/api/include/opentelemetry/common/attribute_value.h
index af4cc83d42..342e889061 100644
--- a/api/include/opentelemetry/common/attribute_value.h
+++ b/api/include/opentelemetry/common/attribute_value.h
@@ -23,12 +23,13 @@ namespace common
/// (IEEE 754-1985) or signed 64 bit integer.
/// - Homogenous arrays of primitive type values.
///
-/// \warning
+/// \warning The OpenTelemetry C++ API does not support the following attribute:
+/// uint64_t, nostd::span, and nostd::span types.
/// \parblock The OpenTelemetry C++ API currently supports several attribute
/// value types that are not covered by the OpenTelemetry specification:
/// - \c uint64_t
/// - \c nostd::span
-/// - \c nostd::span
+/// - \c nostd::span
///
/// Those types are reserved for future use and currently should not be
/// used. There are no guarantees around how those values are handled by
@@ -54,8 +55,6 @@ using AttributeValue =
// Not currently supported by the specification, but reserved for future use.
// Added to provide support for all primitive C++ types.
nostd::span,
- // Not currently supported by the specification, but reserved for future use.
- // See https://github.com/open-telemetry/opentelemetry-specification/issues/780
nostd::span>;
enum AttributeType
diff --git a/api/include/opentelemetry/common/key_value_iterable.h b/api/include/opentelemetry/common/key_value_iterable.h
index 9d43e1571b..4d191b07b7 100644
--- a/api/include/opentelemetry/common/key_value_iterable.h
+++ b/api/include/opentelemetry/common/key_value_iterable.h
@@ -43,13 +43,12 @@ class NoopKeyValueIterable : public KeyValueIterable
~NoopKeyValueIterable() override = default;
/**
- * Iterate over key-value pairs
- * @param callback a callback to invoke for each key-value. If the callback returns false,
- * the iteration is aborted.
- * @return true if every key-value pair was iterated over
+ * No-op implementation: does not invoke the callback, even if key-value pairs are present.
+ * @return true without iterating or invoking the callback
*/
bool ForEachKeyValue(
- nostd::function_ref) const noexcept override
+ nostd::function_ref /*callback*/)
+ const noexcept override
{
return true;
}
diff --git a/api/include/opentelemetry/common/key_value_iterable_view.h b/api/include/opentelemetry/common/key_value_iterable_view.h
index fb1a6ea019..a8fe310321 100644
--- a/api/include/opentelemetry/common/key_value_iterable_view.h
+++ b/api/include/opentelemetry/common/key_value_iterable_view.h
@@ -3,9 +3,14 @@
#pragma once
+#include
+#include
#include
+#include
#include
+#include
+#include "opentelemetry/common/attribute_value.h"
#include "opentelemetry/common/key_value_iterable.h"
#include "opentelemetry/nostd/function_ref.h"
#include "opentelemetry/nostd/span.h"
@@ -86,7 +91,7 @@ KeyValueIterableView MakeKeyValueIterableView(const T &container) noexcept
/**
* Utility function to help to make a attribute view from initializer_list
*
- * @param attributes
+ * @param attributes The initializer_list of key-value pairs
* @return nostd::span>
*/
inline static nostd::span>
@@ -100,7 +105,7 @@ MakeAttributes(std::initializer_list>
*/
inline static nostd::span>
@@ -113,7 +118,7 @@ MakeAttributes(
/**
* Utility function to help to make a attribute view from a KeyValueIterable
*
- * @param attributes
+ * @param attributes The KeyValueIterable of key-value pairs
* @return common::KeyValueIterable
*/
inline static const common::KeyValueIterable &MakeAttributes(
@@ -125,16 +130,17 @@ inline static const common::KeyValueIterable &MakeAttributes(
/**
* Utility function to help to make a attribute view from a key-value iterable object
*
- * @param attributes
+ * @tparam ArgumentType Expected to be ArgumentType
+ * @param attributes The key-value iterable object
* @return nostd::span>
*/
template <
class ArgumentType,
nostd::enable_if_t::value> * = nullptr>
inline static common::KeyValueIterableView MakeAttributes(
- const ArgumentType &arg) noexcept
+ const ArgumentType &attributes) noexcept
{
- return common::KeyValueIterableView(arg);
+ return common::KeyValueIterableView(attributes);
}
} // namespace common
diff --git a/api/include/opentelemetry/common/macros.h b/api/include/opentelemetry/common/macros.h
index b4a270084d..71d12a57bf 100644
--- a/api/include/opentelemetry/common/macros.h
+++ b/api/include/opentelemetry/common/macros.h
@@ -341,7 +341,7 @@ point.
// Atomic wrappers based on compiler intrinsics for memory read/write.
// The tailing number is read/write length in bits.
//
-// N.B. Compiler instrinsic is used because the usage of C++ standard library is restricted in the
+// N.B. Compiler intrinsic is used because the usage of C++ standard library is restricted in the
// OpenTelemetry C++ API.
//
#if defined(__GNUC__)
@@ -387,6 +387,37 @@ point.
#endif
+// OPENTELEMETRY_HAVE_EXCEPTIONS
+//
+// Checks whether the compiler both supports and enables exceptions. Many
+// compilers support a "no exceptions" mode that disables exceptions.
+//
+// Generally, when OPENTELEMETRY_HAVE_EXCEPTIONS is not defined:
+//
+// * Code using `throw` and `try` may not compile.
+// * The `noexcept` specifier will still compile and behave as normal.
+// * The `noexcept` operator may still return `false`.
+//
+// For further details, consult the compiler's documentation.
+#ifndef OPENTELEMETRY_HAVE_EXCEPTIONS
+# if defined(__clang__) && ((__clang_major__ * 100) + __clang_minor__) < 306
+// Clang < 3.6
+// http://releases.llvm.org/3.6.0/tools/clang/docs/ReleaseNotes.html#the-exceptions-macro
+# if defined(__EXCEPTIONS) && OPENTELEMETRY_HAVE_FEATURE(cxx_exceptions)
+# define OPENTELEMETRY_HAVE_EXCEPTIONS 1
+# endif // defined(__EXCEPTIONS) && OPENTELEMETRY_HAVE_FEATURE(cxx_exceptions)
+# elif OPENTELEMETRY_HAVE_FEATURE(cxx_exceptions)
+# define OPENTELEMETRY_HAVE_EXCEPTIONS 1
+// Handle remaining special cases and default to exceptions being supported.
+# elif !(defined(__GNUC__) && !defined(__EXCEPTIONS) && !defined(__cpp_exceptions)) && \
+ !(defined(_MSC_VER) && !defined(_CPPUNWIND))
+# define OPENTELEMETRY_HAVE_EXCEPTIONS 1
+# endif
+#endif
+#ifndef OPENTELEMETRY_HAVE_EXCEPTIONS
+# define OPENTELEMETRY_HAVE_EXCEPTIONS 0
+#endif
+
/*
OPENTELEMETRY_ATTRIBUTE_LIFETIME_BOUND indicates that a resource owned by a function
parameter or implicit object parameter is retained by the return value of the
diff --git a/api/include/opentelemetry/common/spin_lock_mutex.h b/api/include/opentelemetry/common/spin_lock_mutex.h
index 369183b953..7031fa4d23 100644
--- a/api/include/opentelemetry/common/spin_lock_mutex.h
+++ b/api/include/opentelemetry/common/spin_lock_mutex.h
@@ -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
diff --git a/api/include/opentelemetry/common/string_util.h b/api/include/opentelemetry/common/string_util.h
index a7070a0acd..273a65272b 100644
--- a/api/include/opentelemetry/common/string_util.h
+++ b/api/include/opentelemetry/common/string_util.h
@@ -15,11 +15,11 @@ class StringUtil
public:
static nostd::string_view Trim(nostd::string_view str, size_t left, size_t right) noexcept
{
- while (left <= right && str[static_cast(left)] == ' ')
+ while (left <= right && isspace(str[left]))
{
left++;
}
- while (left <= right && str[static_cast(right)] == ' ')
+ while (left <= right && isspace(str[right]))
{
right--;
}
diff --git a/api/include/opentelemetry/config.h b/api/include/opentelemetry/config.h
index 21a2947e28..cb52f3b5dc 100644
--- a/api/include/opentelemetry/config.h
+++ b/api/include/opentelemetry/config.h
@@ -3,12 +3,17 @@
#pragma once
-#ifndef __has_include
-# define OPENTELEMETRY_HAS_INCLUDE(x) 0
-#else
-# define OPENTELEMETRY_HAS_INCLUDE(x) __has_include(x)
-#endif
+#include // IWYU pragma: keep
-#if !defined(__GLIBCXX__) || OPENTELEMETRY_HAS_INCLUDE() // >= libstdc++-5
-# define OPENTELEMETRY_TRIVIALITY_TYPE_TRAITS
+#if defined(OPENTELEMETRY_ABI_VERSION_NO) && OPENTELEMETRY_ABI_VERSION_NO >= 2
+# error \
+ "opentelemetry/config.h is removed in ABI version 2 and later. Please use opentelemetry/version.h instead."
+#else
+# if defined(__clang__) || defined(__GNUC__)
+# pragma GCC warning \
+ "opentelemetry/config.h is deprecated. Please use opentelemetry/version.h instead."
+# elif defined(_MSC_VER)
+# pragma message( \
+ "[WARNING]: opentelemetry/config.h is deprecated. Please use opentelemetry/version.h instead.")
+# endif
#endif
diff --git a/api/include/opentelemetry/context/context.h b/api/include/opentelemetry/context/context.h
index cf5c9cd319..924036efad 100644
--- a/api/include/opentelemetry/context/context.h
+++ b/api/include/opentelemetry/context/context.h
@@ -4,9 +4,12 @@
#pragma once
#include
+#include
+
#include "opentelemetry/context/context_value.h"
#include "opentelemetry/nostd/shared_ptr.h"
#include "opentelemetry/nostd/string_view.h"
+#include "opentelemetry/nostd/variant.h"
#include "opentelemetry/version.h"
OPENTELEMETRY_BEGIN_NAMESPACE
@@ -26,16 +29,14 @@ class Context
// hold a shared_ptr to the head of the DataList linked list
template
Context(const T &keys_and_values) noexcept
- {
- head_ = nostd::shared_ptr