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/workflows/benchmark.yml b/.github/workflows/benchmark.yml
index 595159ca09..5dba836379 100644
--- a/.github/workflows/benchmark.yml
+++ b/.github/workflows/benchmark.yml
@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -21,7 +21,7 @@ jobs:
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -55,12 +55,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # main March 2025
+ - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # main March 2025
with:
name: benchmark_results
path: benchmarks
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2ee56c0f25..d86bc53410 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -38,7 +38,7 @@ jobs:
CXX_STANDARD: '17'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -58,10 +58,11 @@ jobs:
runs-on: ubuntu-24.04
env:
CXX_STANDARD: '17'
+ CMAKE_VERSION: '3.14.0'
BUILD_TYPE: 'Debug'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -70,10 +71,11 @@ jobs:
- name: setup
run: |
sudo -E ./ci/setup_ci_environment.sh
+ sudo -E ./ci/setup_cmake.sh
- name: install dependencies
run: |
sudo -E apt-get update
- sudo -E apt-get install -y zlib1g-dev libcurl4-openssl-dev libabsl-dev libprotobuf-dev libgrpc++-dev protobuf-compiler protobuf-compiler-grpc
+ sudo -E apt-get install -y zlib1g-dev
- name: run fetch content cmake test
run: |
./ci/do_ci.sh cmake.fetch_content.test
@@ -87,7 +89,7 @@ jobs:
CXX_STANDARD: '14'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -121,7 +123,7 @@ jobs:
CXX_STANDARD: '14'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -155,7 +157,7 @@ jobs:
CXX_STANDARD: '14'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -189,7 +191,7 @@ jobs:
CXX_STANDARD: '14'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -223,7 +225,7 @@ jobs:
CXX_STANDARD: '14'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -253,7 +255,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -271,7 +273,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -291,7 +293,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -311,7 +313,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -337,7 +339,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -355,7 +357,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -375,7 +377,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -395,7 +397,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -419,7 +421,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -453,7 +455,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -477,7 +479,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -511,7 +513,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -544,7 +546,7 @@ jobs:
CXX_STANDARD: '14'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -565,7 +567,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -587,7 +589,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -609,7 +611,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -633,7 +635,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -641,7 +643,7 @@ jobs:
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -659,7 +661,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -667,7 +669,7 @@ jobs:
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -685,7 +687,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -693,7 +695,7 @@ jobs:
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -711,7 +713,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -719,7 +721,7 @@ jobs:
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -737,7 +739,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -745,7 +747,7 @@ jobs:
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -763,7 +765,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -771,7 +773,7 @@ jobs:
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -789,7 +791,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -797,7 +799,7 @@ jobs:
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -815,7 +817,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -823,7 +825,7 @@ jobs:
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -841,7 +843,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -849,7 +851,7 @@ jobs:
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -863,7 +865,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -871,7 +873,7 @@ jobs:
with:
submodules: 'recursive'
- name: Mount Bazel Cache
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
env:
cache-name: bazel_cache
with:
@@ -896,7 +898,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -911,7 +913,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -924,7 +926,7 @@ jobs:
runs-on: windows-2022
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -945,7 +947,7 @@ jobs:
runs-on: windows-2022
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -968,7 +970,7 @@ jobs:
runs-on: windows-2022
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -989,7 +991,7 @@ jobs:
runs-on: windows-2022
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -1007,7 +1009,7 @@ jobs:
runs-on: windows-2022
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -1025,7 +1027,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -1053,7 +1055,7 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -1070,7 +1072,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -1085,7 +1087,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -1103,7 +1105,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -1119,7 +1121,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
diff --git a/.github/workflows/clang-tidy.yaml b/.github/workflows/clang-tidy.yaml
index 9e976c4a54..9d7abda33d 100644
--- a/.github/workflows/clang-tidy.yaml
+++ b/.github/workflows/clang-tidy.yaml
@@ -17,12 +17,12 @@ jobs:
matrix:
include:
- cmake_options: all-options-abiv1-preview
- warning_limit: 62
+ warning_limit: 61
- cmake_options: all-options-abiv2-preview
- warning_limit: 62
+ warning_limit: 61
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
diff --git a/.github/workflows/cmake_install.yml b/.github/workflows/cmake_install.yml
index 5173744b37..8bee2b2161 100644
--- a/.github/workflows/cmake_install.yml
+++ b/.github/workflows/cmake_install.yml
@@ -19,7 +19,7 @@ jobs:
CXX_STANDARD: '17'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -41,7 +41,7 @@ jobs:
CXX_STANDARD: '20'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -64,7 +64,7 @@ jobs:
BUILD_TYPE: 'Debug'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -88,7 +88,7 @@ jobs:
run: ./ci/do_ci.sh cmake.install.test
ubuntu_2404_latest:
- name: Ubuntu 24.04 latest versions cxx20 (static libs)
+ name: Ubuntu 24.04 latest versions cxx20 (static libs - shared libs)
runs-on: ubuntu-24.04
env:
INSTALL_TEST_DIR: '/home/runner/install_test'
@@ -96,7 +96,7 @@ jobs:
BUILD_TYPE: 'Debug'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -112,6 +112,10 @@ jobs:
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)
@@ -122,7 +126,7 @@ jobs:
BUILD_TYPE: 'Debug'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -155,7 +159,7 @@ jobs:
BUILD_TYPE: 'Debug'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -187,7 +191,7 @@ jobs:
BUILD_TYPE: 'Debug'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -224,7 +228,7 @@ jobs:
BUILD_TYPE: 'Debug'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -261,7 +265,7 @@ jobs:
BUILD_TYPE: 'Debug'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -290,7 +294,7 @@ jobs:
BUILD_TYPE: 'Debug'
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 6442f9ca4b..cd3adf143c 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -37,10 +37,10 @@ jobs:
run: |
sudo -E ./ci/setup_ci_environment.sh
- name: Initialize CodeQL
- uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
+ uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.8
with:
languages: cpp
- name: Autobuild
- uses: github/codeql-action/autobuild@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
+ uses: github/codeql-action/autobuild@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.8
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
+ uses: github/codeql-action/analyze@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.8
diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml
index 77f7341a7c..ec11d4e9c6 100644
--- a/.github/workflows/cppcheck.yml
+++ b/.github/workflows/cppcheck.yml
@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
diff --git a/.github/workflows/dependencies_image.yml b/.github/workflows/dependencies_image.yml
index e4db90b730..6b518e441d 100644
--- a/.github/workflows/dependencies_image.yml
+++ b/.github/workflows/dependencies_image.yml
@@ -13,7 +13,7 @@ jobs:
timeout-minutes: 300
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
diff --git a/.github/workflows/fossa.yml b/.github/workflows/fossa.yml
index fdce8b8856..1a7ab4e426 100644
--- a/.github/workflows/fossa.yml
+++ b/.github/workflows/fossa.yml
@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml
index 37264404bd..76c9c93bc7 100644
--- a/.github/workflows/iwyu.yml
+++ b/.github/workflows/iwyu.yml
@@ -26,7 +26,7 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
diff --git a/.github/workflows/ossf-scorecard.yml b/.github/workflows/ossf-scorecard.yml
index d5d7264074..09f0ba7f0d 100644
--- a/.github/workflows/ossf-scorecard.yml
+++ b/.github/workflows/ossf-scorecard.yml
@@ -20,7 +20,7 @@ jobs:
id-token: write
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
@@ -47,6 +47,6 @@ jobs:
# 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@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
+ 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 b29e13039c..1ad6bf2036 100644
--- a/.github/workflows/project_management_comment.yml
+++ b/.github/workflows/project_management_comment.yml
@@ -15,7 +15,7 @@ jobs:
issues: write
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
diff --git a/.github/workflows/project_management_issue_open.yml b/.github/workflows/project_management_issue_open.yml
index a80cd037ee..1377a416c2 100644
--- a/.github/workflows/project_management_issue_open.yml
+++ b/.github/workflows/project_management_issue_open.yml
@@ -14,7 +14,7 @@ jobs:
issues: write
steps:
- name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 92e69cc491..bbcc8d708d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,29 @@ 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
@@ -1404,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 bfe0071498..1a6f9cf99a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -261,6 +261,9 @@ option(WITH_METRICS_EXEMPLAR_PREVIEW
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)
@@ -304,89 +307,6 @@ endif()
# GNUInstallDirs.
include(GNUInstallDirs)
-if(WITH_PROMETHEUS)
- include("${opentelemetry-cpp_SOURCE_DIR}/cmake/prometheus-cpp.cmake")
-endif()
-
-if(WITH_OTLP_GRPC
- OR WITH_OTLP_HTTP
- OR WITH_OTLP_FILE)
-
- # Including the CMakeFindDependencyMacro resolves an error from
- # gRPCConfig.cmake on some grpc versions. See
- # https://github.com/grpc/grpc/pull/33361 for more details.
- include(CMakeFindDependencyMacro)
-
- # Protobuf 3.22+ depends on abseil-cpp and must be found using the cmake
- # find_package CONFIG search mode. The following attempts to find Protobuf
- # using the CONFIG mode first, and if not found, falls back to the MODULE
- # mode. See https://gitlab.kitware.com/cmake/cmake/-/issues/24321 for more
- # details.
- find_package(Protobuf CONFIG)
- if(NOT Protobuf_FOUND)
- find_package(Protobuf MODULE)
- if(Protobuf_FOUND AND Protobuf_VERSION VERSION_GREATER_EQUAL "3.22.0")
- message(
- WARNING
- "Found Protobuf version ${Protobuf_VERSION} using MODULE mode. "
- "Linking errors may occur. Protobuf 3.22+ depends on abseil-cpp "
- "and should be found using the CONFIG mode.")
- endif()
- endif()
-
- if(WITH_OTLP_GRPC)
- find_package(gRPC CONFIG)
- endif()
- if((NOT Protobuf_FOUND) OR (WITH_OTLP_GRPC AND NOT gRPC_FOUND))
-
- 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)
- find_package(Protobuf CONFIG REQUIRED)
- endif()
- if(NOT gRPC_FOUND AND WITH_OTLP_GRPC)
- find_package(gRPC CONFIG)
- 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)
- if(CMAKE_CROSSCOMPILING AND Protobuf_PROTOC_EXECUTABLE)
- set(PROTOBUF_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE})
- else()
- 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()
- 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}")
- set(SAVED_CMAKE_CXX_CLANG_TIDY ${CMAKE_CXX_CLANG_TIDY})
- set(CMAKE_CXX_CLANG_TIDY "")
- include("${opentelemetry-cpp_SOURCE_DIR}/cmake/opentelemetry-proto.cmake")
- set(CMAKE_CXX_CLANG_TIDY ${SAVED_CMAKE_CXX_CLANG_TIDY})
-endif()
-
#
# Do we need HTTP CLIENT CURL ?
#
@@ -401,34 +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)
- # Set the CURL_VERSION from the legacy CURL_VERSION_STRING Required for CMake
- # versions below 4.0
- if(NOT DEFINED CURL_VERSION AND DEFINED CURL_VERSION_STRING)
- set(CURL_VERSION ${CURL_VERSION_STRING})
- endif()
+ 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)
- # Set the ZLIB_VERSION from the legacy ZLIB_VERSION_STRING Required for CMake
- # versions below 3.26
- if(NOT DEFINED ZLIB_VERSION AND DEFINED ZLIB_VERSION_STRING)
- set(ZLIB_VERSION ${ZLIB_VERSION_STRING})
+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()
#
@@ -652,17 +587,20 @@ if(opentelemetry-proto_VERSION)
"opentelemetry-proto: ${opentelemetry-proto_VERSION} (${opentelemetry-proto_PROVIDER})"
)
endif()
-if(Protobuf_FOUND)
- message(STATUS "Protobuf: ${Protobuf_VERSION}")
+if(Protobuf_VERSION)
+ message(
+ STATUS
+ "Protobuf: ${Protobuf_VERSION} (${Protobuf_PROVIDER} - ${protobuf_lib_type})"
+ )
endif()
-if(gRPC_FOUND)
- message(STATUS "gRPC: ${gRPC_VERSION}")
+if(gRPC_VERSION)
+ message(STATUS "gRPC: ${gRPC_VERSION} (${gRPC_PROVIDER} - ${grpc_lib_type})")
endif()
-if(CURL_FOUND)
- message(STATUS "CURL: ${CURL_VERSION}")
+if(CURL_VERSION)
+ message(STATUS "CURL: ${CURL_VERSION} (${CURL_PROVIDER})")
endif()
-if(ZLIB_FOUND)
- message(STATUS "ZLIB: ${ZLIB_VERSION}")
+if(ZLIB_VERSION)
+ message(STATUS "ZLIB: ${ZLIB_VERSION} (${ZLIB_PROVIDER})")
endif()
if(USE_NLOHMANN_JSON)
message(
@@ -710,6 +648,9 @@ if(NOT WITH_API_ONLY)
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)
diff --git a/ci/do_ci.ps1 b/ci/do_ci.ps1
index 0b21bbd866..f17ab8b98b 100644
--- a/ci/do_ci.ps1
+++ b/ci/do_ci.ps1
@@ -110,9 +110,8 @@ switch ($action) {
"cmake.maintainer.test" {
cd "$BUILD_DIR"
cmake $SRC_DIR `
- -DWITH_OTLP_GRPC=ON `
- -DWITH_OTLP_HTTP=ON `
- -DWITH_OTLP_RETRY_PREVIEW=ON `
+ "-C $SRC_DIR/test_common/cmake/all-options-abiv1-preview.cmake" `
+ -DWITH_OPENTRACING=OFF `
-DOTELCPP_MAINTAINER_MODE=ON `
-DWITH_NO_DEPRECATED_CODE=ON `
-DVCPKG_TARGET_TRIPLET=x64-windows `
@@ -135,11 +134,10 @@ switch ($action) {
"cmake.maintainer.cxx20.stl.test" {
cd "$BUILD_DIR"
cmake $SRC_DIR `
+ "-C $SRC_DIR/test_common/cmake/all-options-abiv1-preview.cmake" `
+ -DWITH_OPENTRACING=OFF `
-DWITH_STL=CXX20 `
-DCMAKE_CXX_STANDARD=20 `
- -DWITH_OTLP_GRPC=ON `
- -DWITH_OTLP_HTTP=ON `
- -DWITH_OTLP_RETRY_PREVIEW=ON `
-DOTELCPP_MAINTAINER_MODE=ON `
-DWITH_NO_DEPRECATED_CODE=ON `
-DVCPKG_TARGET_TRIPLET=x64-windows `
@@ -162,13 +160,10 @@ switch ($action) {
"cmake.maintainer.abiv2.test" {
cd "$BUILD_DIR"
cmake $SRC_DIR `
- -DWITH_OTLP_GRPC=ON `
- -DWITH_OTLP_HTTP=ON `
- -DWITH_OTLP_RETRY_PREVIEW=ON `
+ "-C $SRC_DIR/test_common/cmake/all-options-abiv2-preview.cmake" `
+ -DWITH_OPENTRACING=OFF `
-DOTELCPP_MAINTAINER_MODE=ON `
-DWITH_NO_DEPRECATED_CODE=ON `
- -DWITH_ABI_VERSION_1=OFF `
- -DWITH_ABI_VERSION_2=ON `
-DVCPKG_TARGET_TRIPLET=x64-windows `
"-DCMAKE_TOOLCHAIN_FILE=$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake"
$exit = $LASTEXITCODE
@@ -210,11 +205,9 @@ switch ($action) {
"cmake.exporter.otprotocol.test" {
cd "$BUILD_DIR"
cmake $SRC_DIR `
- -DVCPKG_TARGET_TRIPLET=x64-windows `
- -DWITH_OTLP_GRPC=ON `
- -DWITH_OTLP_HTTP=ON `
- -DWITH_OTLP_RETRY_PREVIEW=ON `
- -DWITH_OTPROTCOL=ON `
+ "-C $SRC_DIR/test_common/cmake/all-options-abiv1-preview.cmake" `
+ -DWITH_OPENTRACING=OFF `
+ -DVCPKG_TARGET_TRIPLET=x64-windows `
"-DCMAKE_TOOLCHAIN_FILE=$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake"
$exit = $LASTEXITCODE
if ($exit -ne 0) {
@@ -257,9 +250,10 @@ switch ($action) {
"cmake.exporter.otprotocol.with_async_export.test" {
cd "$BUILD_DIR"
cmake $SRC_DIR `
+ "-C $SRC_DIR/test_common/cmake/all-options-abiv1-preview.cmake" `
+ -DWITH_OPENTRACING=OFF `
-DVCPKG_TARGET_TRIPLET=x64-windows `
-DWITH_ASYNC_EXPORT_PREVIEW=ON `
- -DWITH_OTPROTCOL=ON `
"-DCMAKE_TOOLCHAIN_FILE=$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake"
$exit = $LASTEXITCODE
if ($exit -ne 0) {
@@ -342,27 +336,9 @@ switch ($action) {
cmake $SRC_DIR `
$CMAKE_OPTIONS `
"-DCMAKE_INSTALL_PREFIX=$INSTALL_TEST_DIR" `
- -DWITH_ABI_VERSION_1=OFF `
- -DWITH_ABI_VERSION_2=ON `
+ "-C $SRC_DIR/test_common/cmake/all-options-abiv2-preview.cmake" `
+ -DWITH_OPENTRACING=OFF `
-DWITH_GSL=ON `
- -DWITH_THREAD_INSTRUMENTATION_PREVIEW=ON `
- -DWITH_METRICS_EXEMPLAR_PREVIEW=ON `
- -DWITH_ASYNC_EXPORT_PREVIEW=ON `
- -DWITH_OTLP_GRPC_SSL_MTLS_PREVIEW=ON `
- -DWITH_OTLP_GRPC_CREDENTIAL_PREVIEW=ON `
- -DWITH_OTLP_RETRY_PREVIEW=ON `
- -DWITH_OTLP_GRPC=ON `
- -DWITH_OTLP_HTTP=ON `
- -DWITH_OTLP_FILE=ON `
- -DWITH_OTLP_HTTP_COMPRESSION=ON `
- -DWITH_HTTP_CLIENT_CURL=ON `
- -DWITH_PROMETHEUS=ON `
- -DWITH_ZIPKIN=ON `
- -DWITH_ELASTICSEARCH=ON `
- -DWITH_ETW=ON `
- -DWITH_EXAMPLES=ON `
- -DWITH_EXAMPLES_HTTP=ON `
- -DBUILD_W3CTRACECONTEXT_TEST=ON `
-DOPENTELEMETRY_INSTALL=ON
$exit = $LASTEXITCODE
@@ -447,13 +423,9 @@ switch ($action) {
cmake $SRC_DIR `
$CMAKE_OPTIONS `
"-DCMAKE_INSTALL_PREFIX=$INSTALL_TEST_DIR" `
- -DWITH_ABI_VERSION_1=ON `
- -DWITH_ABI_VERSION_2=OFF `
- -DWITH_THREAD_INSTRUMENTATION_PREVIEW=ON `
- -DWITH_METRICS_EXEMPLAR_PREVIEW=ON `
- -DWITH_ASYNC_EXPORT_PREVIEW=ON `
- -DWITH_ETW=ON `
+ "-C $SRC_DIR/test_common/cmake/all-options-abiv1-preview.cmake" `
-DOPENTELEMETRY_INSTALL=ON `
+ -DWITH_OPENTRACING=OFF `
-DWITH_OTLP_GRPC_SSL_MTLS_PREVIEW=OFF `
-DWITH_OTLP_GRPC_CREDENTIAL_PREVIEW=OFF `
-DWITH_OTLP_RETRY_PREVIEW=OFF `
@@ -466,6 +438,7 @@ switch ($action) {
-DWITH_ZIPKIN=OFF `
-DWITH_ELASTICSEARCH=OFF `
-DWITH_EXAMPLES=OFF `
+ -DWITH_EXAMPLES_HTTP=OFF
$exit = $LASTEXITCODE
if ($exit -ne 0) {
diff --git a/ci/do_ci.sh b/ci/do_ci.sh
index e9cea09648..2eff9cd200 100755
--- a/ci/do_ci.sh
+++ b/ci/do_ci.sh
@@ -124,22 +124,11 @@ elif [[ "$1" == "cmake.maintainer.sync.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake "${CMAKE_OPTIONS[@]}" \
- -DWITH_OTLP_HTTP=ON \
- -DWITH_OTLP_GRPC=ON \
- -DWITH_OTLP_FILE=ON \
- -DWITH_PROMETHEUS=ON \
- -DWITH_EXAMPLES=ON \
- -DWITH_EXAMPLES_HTTP=ON \
- -DWITH_ZIPKIN=ON \
- -DBUILD_W3CTRACECONTEXT_TEST=ON \
- -DWITH_ELASTICSEARCH=ON \
- -DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
+ -C ${SRC_DIR}/test_common/cmake/all-options-abiv1-preview.cmake \
+ -DWITH_OPENTRACING=OFF \
-DWITH_ASYNC_EXPORT_PREVIEW=OFF \
-DOTELCPP_MAINTAINER_MODE=ON \
-DWITH_NO_DEPRECATED_CODE=ON \
- -DWITH_OTLP_HTTP_COMPRESSION=ON \
- -DWITH_OTLP_RETRY_PREVIEW=ON \
- -DWITH_THREAD_INSTRUMENTATION_PREVIEW=ON \
"${SRC_DIR}"
eval "$MAKE_COMMAND"
make test
@@ -148,22 +137,10 @@ elif [[ "$1" == "cmake.maintainer.async.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake "${CMAKE_OPTIONS[@]}" \
- -DWITH_OTLP_HTTP=ON \
- -DWITH_OTLP_GRPC=ON \
- -DWITH_OTLP_FILE=ON \
- -DWITH_PROMETHEUS=ON \
- -DWITH_EXAMPLES=ON \
- -DWITH_EXAMPLES_HTTP=ON \
- -DWITH_ZIPKIN=ON \
- -DBUILD_W3CTRACECONTEXT_TEST=ON \
- -DWITH_ELASTICSEARCH=ON \
- -DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
- -DWITH_ASYNC_EXPORT_PREVIEW=ON \
+ -C ${SRC_DIR}/test_common/cmake/all-options-abiv1-preview.cmake \
+ -DWITH_OPENTRACING=OFF \
-DOTELCPP_MAINTAINER_MODE=ON \
-DWITH_NO_DEPRECATED_CODE=ON \
- -DWITH_OTLP_HTTP_COMPRESSION=ON \
- -DWITH_OTLP_RETRY_PREVIEW=ON \
- -DWITH_THREAD_INSTRUMENTATION_PREVIEW=ON \
"${SRC_DIR}"
eval "$MAKE_COMMAND"
make test
@@ -173,21 +150,10 @@ elif [[ "$1" == "cmake.maintainer.cpp11.async.test" ]]; then
rm -rf *
cmake "${CMAKE_OPTIONS[@]}" \
-DCMAKE_CXX_STANDARD=11 \
- -DWITH_OTLP_HTTP=ON \
- -DWITH_OTLP_FILE=ON \
- -DWITH_PROMETHEUS=ON \
- -DWITH_EXAMPLES=ON \
- -DWITH_EXAMPLES_HTTP=ON \
- -DWITH_ZIPKIN=ON \
- -DBUILD_W3CTRACECONTEXT_TEST=ON \
- -DWITH_ELASTICSEARCH=ON \
- -DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
- -DWITH_ASYNC_EXPORT_PREVIEW=ON \
+ -C ${SRC_DIR}/test_common/cmake/all-options-abiv1-preview.cmake \
+ -DWITH_OPENTRACING=OFF \
-DOTELCPP_MAINTAINER_MODE=ON \
-DWITH_NO_DEPRECATED_CODE=ON \
- -DWITH_OTLP_HTTP_COMPRESSION=ON \
- -DWITH_OTLP_RETRY_PREVIEW=ON \
- -DWITH_THREAD_INSTRUMENTATION_PREVIEW=ON \
"${SRC_DIR}"
make -k -j $(nproc)
make test
@@ -196,24 +162,11 @@ elif [[ "$1" == "cmake.maintainer.abiv2.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake "${CMAKE_OPTIONS[@]}" \
- -DWITH_OTLP_HTTP=ON \
- -DWITH_OTLP_GRPC=ON \
- -DWITH_OTLP_FILE=ON \
- -DWITH_PROMETHEUS=ON \
- -DWITH_EXAMPLES=ON \
- -DWITH_EXAMPLES_HTTP=ON \
- -DWITH_ZIPKIN=ON \
- -DBUILD_W3CTRACECONTEXT_TEST=ON \
- -DWITH_ELASTICSEARCH=ON \
- -DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
+ -C ${SRC_DIR}/test_common/cmake/all-options-abiv2-preview.cmake \
+ -DWITH_OPENTRACING=OFF \
-DWITH_ASYNC_EXPORT_PREVIEW=OFF \
-DOTELCPP_MAINTAINER_MODE=ON \
-DWITH_NO_DEPRECATED_CODE=ON \
- -DWITH_ABI_VERSION_1=OFF \
- -DWITH_ABI_VERSION_2=ON \
- -DWITH_OTLP_HTTP_COMPRESSION=ON \
- -DWITH_OTLP_RETRY_PREVIEW=ON \
- -DWITH_THREAD_INSTRUMENTATION_PREVIEW=ON \
"${SRC_DIR}"
eval "$MAKE_COMMAND"
make test
@@ -400,6 +353,7 @@ elif [[ "$1" == "cmake.exporter.otprotocol.shared_libs.with_static_grpc.test" ]]
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_FILE=ON \
-DBUILD_SHARED_LIBS=ON \
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
"${SRC_DIR}"
grpc_cpp_plugin=`which grpc_cpp_plugin`
proto_make_file="CMakeFiles/opentelemetry_proto.dir/build.make"
@@ -464,25 +418,7 @@ elif [[ "$1" == "cmake.install.test" ]]; then
cmake "${CMAKE_OPTIONS[@]}" \
-DCMAKE_INSTALL_PREFIX=${INSTALL_TEST_DIR} \
- -DWITH_ABI_VERSION_1=OFF \
- -DWITH_ABI_VERSION_2=ON \
- -DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
- -DWITH_ASYNC_EXPORT_PREVIEW=ON \
- -DWITH_THREAD_INSTRUMENTATION_PREVIEW=ON \
- -DWITH_OTLP_GRPC_SSL_MTLS_PREVIEW=ON \
- -DWITH_OTLP_GRPC_CREDENTIAL_PREVIEW=ON \
- -DWITH_OTLP_RETRY_PREVIEW=ON \
- -DWITH_OTLP_GRPC=ON \
- -DWITH_OTLP_HTTP=ON \
- -DWITH_OTLP_FILE=ON \
- -DWITH_OTLP_HTTP_COMPRESSION=ON \
- -DWITH_HTTP_CLIENT_CURL=ON \
- -DWITH_PROMETHEUS=ON \
- -DWITH_ZIPKIN=ON \
- -DWITH_ELASTICSEARCH=ON \
- -DWITH_EXAMPLES=ON \
- -DWITH_EXAMPLES_HTTP=ON \
- -DBUILD_W3CTRACECONTEXT_TEST=ON \
+ -C ${SRC_DIR}/test_common/cmake/all-options-abiv2-preview.cmake \
-DOPENTELEMETRY_INSTALL=ON \
"${SRC_DIR}"
@@ -532,25 +468,7 @@ elif [[ "$1" == "cmake.fetch_content.test" ]]; then
rm -rf *
cmake "${CMAKE_OPTIONS[@]}" \
-DCMAKE_INSTALL_PREFIX=${INSTALL_TEST_DIR} \
- -DWITH_ABI_VERSION_1=OFF \
- -DWITH_ABI_VERSION_2=ON \
- -DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
- -DWITH_ASYNC_EXPORT_PREVIEW=ON \
- -DWITH_THREAD_INSTRUMENTATION_PREVIEW=ON \
- -DWITH_OTLP_GRPC_SSL_MTLS_PREVIEW=ON \
- -DWITH_OTLP_GRPC_CREDENTIAL_PREVIEW=ON \
- -DWITH_OTLP_RETRY_PREVIEW=ON \
- -DWITH_OTLP_GRPC=ON \
- -DWITH_OTLP_HTTP=ON \
- -DWITH_OTLP_FILE=ON \
- -DWITH_OTLP_HTTP_COMPRESSION=ON \
- -DWITH_HTTP_CLIENT_CURL=ON \
- -DWITH_PROMETHEUS=ON \
- -DWITH_ZIPKIN=ON \
- -DWITH_ELASTICSEARCH=ON \
- -DWITH_EXAMPLES=ON \
- -DWITH_EXAMPLES_HTTP=ON \
- -DBUILD_W3CTRACECONTEXT_TEST=ON \
+ -C ${SRC_DIR}/test_common/cmake/all-options-abiv2-preview.cmake \
-DOPENTELEMETRY_INSTALL=OFF \
-DOPENTELEMETRY_CPP_SRC_DIR="${SRC_DIR}" \
"${SRC_DIR}/install/test/cmake/fetch_content_test"
diff --git a/ci/install_abseil.sh b/ci/install_abseil.sh
deleted file mode 100755
index 04ac0e0037..0000000000
--- a/ci/install_abseil.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-
-# Copyright The OpenTelemetry Authors
-# SPDX-License-Identifier: Apache-2.0
-
-set -ex
-export DEBIAN_FRONTEND=noninteractive
-[ -z "${ABSEIL_CPP_VERSION}" ] && export ABSEIL_CPP_VERSION="20240116.1"
-
-TOPDIR=`pwd`
-
-BUILD_DIR=/tmp/
-INSTALL_DIR=/usr/local/
-pushd $BUILD_DIR
-git clone --depth=1 -b ${ABSEIL_CPP_VERSION} https://github.com/abseil/abseil-cpp.git
-cd abseil-cpp
-ABSEIL_CPP_BUILD_OPTIONS=(
- "-DBUILD_TESTING=OFF"
- "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
- "-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR"
-)
-
-if [ ! -z "${CXX_STANDARD}" ]; then
- ABSEIL_CPP_BUILD_OPTIONS+=("-DCMAKE_CXX_STANDARD=${CXX_STANDARD}")
- ABSEIL_CPP_BUILD_OPTIONS+=("-DCMAKE_CXX_STANDARD_REQUIRED=ON")
- ABSEIL_CPP_BUILD_OPTIONS+=("-DCMAKE_CXX_EXTENSIONS=OFF")
-fi
-
-#
-# ABSEIL_CPP_VERSION="20240116.1" fails to build with CMake 3.30
-# ABSEIL_CPP_VERSION="20240116.2" fails to build with CMake 3.30
-# note that somehow the same builds with CMake 3.29.6
-#
-# Error reported:
-# CMake Error at CMake/AbseilHelpers.cmake:317 (target_link_libraries):
-# The link interface of target "test_allocator" contains:
-#
-# GTest::gmock
-#
-# but the target was not found. Possible reasons include:
-#
-# * There is a typo in the target name.
-# * A find_package call is missing for an IMPORTED target.
-# * An ALIAS target is missing.
-#
-# Call Stack (most recent call first):
-# absl/container/CMakeLists.txt:206 (absl_cc_library)
-#
-# Root cause:
-# https://github.com/abseil/abseil-cpp/pull/1536
-#
-# Applying fix from abseil commit 779a3565ac6c5b69dd1ab9183e500a27633117d5
-#
-# TODO(marcalff) Cleanup once abseil is upgraded to the next LTS
-
-
-if [ "${ABSEIL_CPP_VERSION}" = "20240116.1" ] || [ "${ABSEIL_CPP_VERSION}" = "20240116.2" ]; then
- echo "Patching abseil"
- patch -p1 < ${TOPDIR}/ci/fix-abseil-cpp-issue-1536.patch
-else
- echo "Not patching abseil"
-fi
-
-echo "Building abseil ${ABSEIL_CPP_VERSION}"
-echo "CMake build options:" "${ABSEIL_CPP_BUILD_OPTIONS[@]}"
-
-mkdir build && pushd build
-cmake "${ABSEIL_CPP_BUILD_OPTIONS[@]}" ..
-make -j $(nproc)
-make install
-popd
-popd
-export PATH=${INSTALL_DIR}/bin:$PATH # ensure to use the installed abseil
diff --git a/ci/install_protobuf.sh b/ci/install_protobuf.sh
deleted file mode 100755
index ac041b6334..0000000000
--- a/ci/install_protobuf.sh
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/bash
-
-# Copyright The OpenTelemetry Authors
-# SPDX-License-Identifier: Apache-2.0
-
-set -e
-
-[ -z "${PROTOBUF_VERSION}" ] && export PROTOBUF_VERSION="21.12"
-
-#
-# Note
-#
-# protobuf uses two release number schemes,
-# for example 3.21.12 and 21.12,
-# and both tags corresponds to the same commit:
-#
-# commit f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c (HEAD -> release-3.21.12, tag: v3.21.12, tag: v21.12)
-# Author: Protobuf Team Bot
-# Date: Mon Dec 12 16:03:12 2022 -0800
-#
-# Updating version.json and repo version numbers to: 21.12
-#
-# tag v21.12 corresponds to the 'protoc version', or repo version
-# tag v3.21.12 corresponds to the 'cpp version'
-#
-# protobuf-cpp-3.21.12.tar.gz:
-# - is provided under releases/download/v21.12
-# - is no longer provided under releases/download/v3.21.12,
-#
-# Use the "repo version number" (PROTOBUF_VERSION=21.12)
-# when calling this script
-#
-
-CPP_PROTOBUF_BUILD_OPTIONS=(
- "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
- "-Dprotobuf_BUILD_TESTS=OFF"
- "-Dprotobuf_BUILD_EXAMPLES=OFF"
-)
-
-if [ ! -z "${CXX_STANDARD}" ]; then
- CPP_PROTOBUF_BUILD_OPTIONS+=("-DCMAKE_CXX_STANDARD=${CXX_STANDARD}")
- CPP_PROTOBUF_BUILD_OPTIONS+=("-DCMAKE_CXX_STANDARD_REQUIRED=ON")
- CPP_PROTOBUF_BUILD_OPTIONS+=("-DCMAKE_CXX_EXTENSIONS=OFF")
-fi
-
-# After protobuf 22/4.22, protobuf depends on absl and we can use
-# "-Dprotobuf_ABSL_PROVIDER=package" to tell protobuf to find absl from the
-# system. Otherwise, it will build absl from source.
-# 4.XX.YY and 3.XX.YY are alias of XX.YY, and source pacakges are moved into the
-# tag of XX.YY and without -cpp suffix from protobuf v22.
-if [[ ${PROTOBUF_VERSION/.*/} -ge 22 ]]; then
- export CPP_PROTOBUF_VERSION="${PROTOBUF_VERSION}"
- CPP_PROTOBUF_PACKAGE_NAME="protobuf-${CPP_PROTOBUF_VERSION}"
- CPP_PROTOBUF_BUILD_OPTIONS=(${CPP_PROTOBUF_BUILD_OPTIONS[@]} "-Dprotobuf_ABSL_PROVIDER=package")
-else
- export CPP_PROTOBUF_VERSION="3.${PROTOBUF_VERSION}"
- CPP_PROTOBUF_PACKAGE_NAME="protobuf-cpp-${CPP_PROTOBUF_VERSION}"
-fi
-
-cd /tmp
-wget https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/${CPP_PROTOBUF_PACKAGE_NAME}.tar.gz
-tar zxf ${CPP_PROTOBUF_PACKAGE_NAME}.tar.gz --no-same-owner
-
-echo "Building protobuf ${CPP_PROTOBUF_VERSION}"
-echo "CMake build options:" "${CPP_PROTOBUF_BUILD_OPTIONS[@]}"
-
-mkdir protobuf-${CPP_PROTOBUF_VERSION}/build && pushd protobuf-${CPP_PROTOBUF_VERSION}/build
-if [ -e "../CMakeLists.txt" ]; then
- cmake .. "${CPP_PROTOBUF_BUILD_OPTIONS[@]}"
-else
- cmake ../cmake "${CPP_PROTOBUF_BUILD_OPTIONS[@]}"
-fi
-make -j $(nproc)
-make install
-popd
-ldconfig
diff --git a/ci/setup_googletest.sh b/ci/setup_googletest.sh
deleted file mode 100755
index 7b4a20840f..0000000000
--- a/ci/setup_googletest.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-
-# Copyright The OpenTelemetry Authors
-# SPDX-License-Identifier: Apache-2.0
-
-set -e
-
-export DEBIAN_FRONTEND=noninteractive
-apt-get update
-
-if [ -z "${GOOGLETEST_VERSION}" ]; then
- # Version by default. Requires C++14.
- export GOOGLETEST_VERSION=1.14.0
-fi
-
-OLD_GOOGLETEST_VERSION_REGEXP="^1\.([0-9]|10|11|12)(\..*)?$"
-
-if [[ ${GOOGLETEST_VERSION} =~ ${OLD_GOOGLETEST_VERSION_REGEXP} ]]; then
- # Old (up to 1.12.x included) download URL format.
- GOOGLETEST_VERSION_PATH="release-${GOOGLETEST_VERSION}"
- GOOGLETEST_FOLDER_PATH="googletest-release-${GOOGLETEST_VERSION}"
-else
- # New (since 1.13.0) download URL format.
- GOOGLETEST_VERSION_PATH="v${GOOGLETEST_VERSION}"
- GOOGLETEST_FOLDER_PATH="googletest-${GOOGLETEST_VERSION}"
-fi
-
-googletest_install()
-{
- # Follows these instructions
- # https://gist.github.com/dlime/313f74fd23e4267c4a915086b84c7d3d
- tmp_dir=$(mktemp -d)
- pushd $tmp_dir
- wget https://github.com/google/googletest/archive/${GOOGLETEST_VERSION_PATH}.tar.gz
- tar -xf ${GOOGLETEST_VERSION_PATH}.tar.gz
- cd ${GOOGLETEST_FOLDER_PATH}/
- mkdir build && cd build
- cmake .. -DBUILD_SHARED_LIBS=ON -DINSTALL_GTEST=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr
- make -j $(nproc)
- make install
- ldconfig
- popd
-}
-
-set +e
-echo \
- libbenchmark-dev \
- zlib1g-dev \
- sudo \
- libcurl4-openssl-dev \
- nlohmann-json-dev \
- nlohmann-json3 \
- nlohmann-json3-dev | xargs -n 1 apt-get install --ignore-missing --no-install-recommends --no-install-suggests -y
-set -e
-
-googletest_install
diff --git a/cmake/curl.cmake b/cmake/curl.cmake
new file mode 100644
index 0000000000..994c1fbd2a
--- /dev/null
+++ b/cmake/curl.cmake
@@ -0,0 +1,76 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+# Import the curl target (CURL::libcurl).
+# 1. Find an installed curl package
+# 2. Use FetchContent to fetch and build curl from GitHub
+
+# Find the curl package with the default search mode
+find_package(CURL QUIET)
+set(CURL_PROVIDER "find_package")
+
+if(NOT CURL_FOUND)
+ FetchContent_Declare(
+ "curl"
+ GIT_REPOSITORY "https://github.com/curl/curl.git"
+ GIT_TAG "${curl_GIT_TAG}"
+ )
+ set(CURL_PROVIDER "fetch_repository")
+
+ if(OPENTELEMETRY_INSTALL)
+ set(_CURL_DISABLE_INSTALL OFF)
+ else()
+ set(_CURL_DISABLE_INSTALL ON)
+ endif()
+
+ if(DEFINED BUILD_SHARED_LIBS)
+ set(_SAVED_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
+ endif()
+
+ set(CURL_DISABLE_INSTALL ${_CURL_DISABLE_INSTALL} CACHE BOOL "" FORCE)
+ set(CURL_USE_LIBPSL OFF CACHE BOOL "" FORCE)
+ set(BUILD_CURL_EXE OFF CACHE BOOL "" FORCE)
+ set(BUILD_LIBCURL_DOCS OFF CACHE BOOL "" FORCE)
+ set(BUILD_MISC_DOCS OFF CACHE BOOL "" FORCE)
+ set(ENABLE_CURL_MANUAL OFF CACHE BOOL "" FORCE)
+ set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
+
+ FetchContent_MakeAvailable(curl)
+
+ # Restore BUILD_SHARED_LIBS
+ if(DEFINED _SAVED_BUILD_SHARED_LIBS)
+ set(BUILD_SHARED_LIBS ${_SAVED_BUILD_SHARED_LIBS} CACHE BOOL "" FORCE)
+ else()
+ unset(BUILD_SHARED_LIBS CACHE)
+ endif()
+
+ # Set the CURL_VERSION variable from the git tag.
+ string(REGEX REPLACE "^curl-([0-9]+)_([0-9]+)_([0-9]+)$" "\\1.\\2.\\3" CURL_VERSION "${curl_GIT_TAG}")
+
+ # disable iwyu and clang-tidy
+ foreach(_curl_target libcurl_shared libcurl_static)
+ if(TARGET ${_curl_target})
+ set_target_properties(${_curl_target} PROPERTIES CXX_INCLUDE_WHAT_YOU_USE ""
+ CXX_CLANG_TIDY "")
+ endif()
+ endforeach()
+endif()
+
+# Set the CURL_VERSION from the legacy CURL_VERSION_STRING Required for CMake
+# versions below 4.0
+if(NOT CURL_VERSION AND CURL_VERSION_STRING)
+ set(CURL_VERSION ${CURL_VERSION_STRING})
+endif()
+
+# Add the main CURL::libcurl alias target if missing. Prefer the shared target followed by the static target
+if(NOT TARGET CURL::libcurl)
+ if(TARGET libcurl_shared)
+ add_library(CURL::libcurl ALIAS libcurl_shared)
+ elseif(TARGET libcurl_static)
+ add_library(CURL::libcurl ALIAS libcurl_static)
+ endif()
+endif()
+
+if(NOT TARGET CURL::libcurl)
+ message(FATAL_ERROR "The required curl target (CURL::libcurl) was not imported.")
+endif()
diff --git a/cmake/grpc.cmake b/cmake/grpc.cmake
new file mode 100644
index 0000000000..b209c0ae5a
--- /dev/null
+++ b/cmake/grpc.cmake
@@ -0,0 +1,84 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+# Import gRPC targets (gRPC::grpc++ and gRPC::grpc_cpp_plugin).
+# 1. Find an installed gRPC package
+# 2. Use FetchContent to fetch and build gRPC (and its submodules) from GitHub
+
+# Including the CMakeFindDependencyMacro resolves an error from
+# gRPCConfig.cmake on some grpc versions. See
+# https://github.com/grpc/grpc/pull/33361 for more details.
+include(CMakeFindDependencyMacro)
+
+find_package(gRPC CONFIG QUIET)
+set(gRPC_PROVIDER "find_package")
+
+if(NOT gRPC_FOUND)
+ FetchContent_Declare(
+ "grpc"
+ GIT_REPOSITORY "https://github.com/grpc/grpc.git"
+ GIT_TAG "${grpc_GIT_TAG}"
+ GIT_SUBMODULES
+ "third_party/re2"
+ "third_party/abseil-cpp"
+ "third_party/protobuf"
+ "third_party/cares/cares"
+ "third_party/boringssl-with-bazel"
+ )
+ set(gRPC_PROVIDER "fetch_repository")
+
+ set(gRPC_INSTALL ${OPENTELEMETRY_INSTALL} CACHE BOOL "" FORCE)
+ set(gRPC_BUILD_TESTS OFF CACHE BOOL "" FORCE)
+ set(gRPC_BUILD_GRPC_CPP_PLUGIN ON CACHE BOOL "" FORCE)
+ set(gRPC_BUILD_GRPC_CSHARP_PLUGIN OFF CACHE BOOL "" FORCE)
+ set(gRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN OFF CACHE BOOL "" FORCE)
+ set(gRPC_BUILD_GRPC_PHP_PLUGIN OFF CACHE BOOL "" FORCE)
+ set(gRPC_BUILD_GRPC_NODE_PLUGIN OFF CACHE BOOL "" FORCE)
+ set(gRPC_BUILD_GRPC_PYTHON_PLUGIN OFF CACHE BOOL "" FORCE)
+ set(gRPC_BUILD_GRPC_RUBY_PLUGIN OFF CACHE BOOL "" FORCE)
+ set(gRPC_BUILD_GRPCPP_OTEL_PLUGIN OFF CACHE BOOL "" FORCE)
+ set(gRPC_ZLIB_PROVIDER "package" CACHE STRING "" FORCE)
+ set(gRPC_RE2_PROVIDER "module" CACHE STRING "" FORCE)
+ set(RE2_BUILD_TESTING OFF CACHE BOOL "" FORCE)
+ set(gRPC_PROTOBUF_PROVIDER "module" CACHE STRING "" FORCE)
+ set(gRPC_PROTOBUF_PACKAGE_TYPE "CONFIG" CACHE STRING "" FORCE)
+ set(gRPC_ABSL_PROVIDER "module" CACHE STRING "" FORCE)
+ set(gRPC_CARES_PROVIDER "module" CACHE STRING "" FORCE)
+
+ FetchContent_MakeAvailable(grpc)
+
+ # Set the gRPC_VERSION variable from the git tag.
+ string(REGEX REPLACE "^v([0-9]+\\.[0-9]+\\.[0-9]+)$" "\\1" gRPC_VERSION "${grpc_GIT_TAG}")
+
+ #Disable iwyu and clang-tidy
+ foreach(_grpc_target grpc++ grpc_cpp_plugin)
+ if(TARGET ${_grpc_target})
+ set_target_properties(${_grpc_target} PROPERTIES POSITION_INDEPENDENT_CODE ON CXX_INCLUDE_WHAT_YOU_USE ""
+ CXX_CLANG_TIDY "")
+ endif()
+ endforeach()
+
+ if(TARGET grpc++ AND NOT TARGET gRPC::grpc++)
+ add_library(gRPC::grpc++ ALIAS grpc++)
+ endif()
+
+ if(TARGET grpc_cpp_plugin AND NOT TARGET gRPC::grpc_cpp_plugin)
+ add_executable(gRPC::grpc_cpp_plugin ALIAS grpc_cpp_plugin)
+ endif()
+
+endif()
+
+if(NOT TARGET gRPC::grpc++)
+ message(FATAL_ERROR "A required gRPC target (gRPC::grpc++) was not imported")
+endif()
+
+if(CMAKE_CROSSCOMPILING)
+ find_program(gRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
+else()
+ if(NOT TARGET gRPC::grpc_cpp_plugin)
+ message(FATAL_ERROR "A required gRPC target (gRPC::grpc_cpp_plugin) was not imported")
+ endif()
+ set(gRPC_CPP_PLUGIN_EXECUTABLE "$")
+endif()
+
+message(STATUS "gRPC_CPP_PLUGIN_EXECUTABLE=${gRPC_CPP_PLUGIN_EXECUTABLE}")
diff --git a/cmake/nlohmann-json.cmake b/cmake/nlohmann-json.cmake
index e441826e97..14e375e9c9 100644
--- a/cmake/nlohmann-json.cmake
+++ b/cmake/nlohmann-json.cmake
@@ -35,8 +35,9 @@ if(NOT nlohmann_json_FOUND)
# Set the nlohmann_json_VERSION variable from the git tag.
string(REGEX REPLACE "^v([0-9]+\\.[0-9]+\\.[0-9]+)$" "\\1" nlohmann_json_VERSION "${nlohmann-json_GIT_TAG}")
- #Disable iwyu and clang-tidy
- if(TARGET nlohmann_json)
+ # Disable iwyu and clang-tidy only if the CMake version is greater or equal to 3.19.
+ # CMake 3.19+ is needed to set the iwyu and clang-tidy properties on the INTERFACE target
+ if(TARGET nlohmann_json AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.19")
set_target_properties(nlohmann_json PROPERTIES CXX_INCLUDE_WHAT_YOU_USE ""
CXX_CLANG_TIDY "")
endif()
diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake
index 7fb74eba51..648d21d2f2 100644
--- a/cmake/opentelemetry-proto.cmake
+++ b/cmake/opentelemetry-proto.cmake
@@ -174,20 +174,6 @@ foreach(IMPORT_DIR ${PROTOBUF_IMPORT_DIRS})
list(APPEND PROTOBUF_INCLUDE_FLAGS "-I${IMPORT_DIR}")
endforeach()
-if(WITH_OTLP_GRPC)
- if(CMAKE_CROSSCOMPILING)
- find_program(gRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
- else()
- if(TARGET gRPC::grpc_cpp_plugin)
- project_build_tools_get_imported_location(gRPC_CPP_PLUGIN_EXECUTABLE
- gRPC::grpc_cpp_plugin)
- else()
- find_program(gRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
- endif()
- endif()
- message(STATUS "gRPC_CPP_PLUGIN_EXECUTABLE=${gRPC_CPP_PLUGIN_EXECUTABLE}")
-endif()
-
set(PROTOBUF_COMMON_FLAGS "--proto_path=${PROTO_PATH}"
"--cpp_out=${GENERATED_PROTOBUF_PATH}")
# --experimental_allow_proto3_optional is available from 3.13 and be stable and
@@ -239,7 +225,10 @@ set(PROTOBUF_GENERATED_FILES
${PROFILES_SERVICE_PB_H_FILE}
${PROFILES_SERVICE_PB_CPP_FILE})
+set(PROTOBUF_GENERATE_DEPENDS ${PROTOBUF_PROTOC_EXECUTABLE})
+
if(WITH_OTLP_GRPC)
+ list(APPEND PROTOBUF_GENERATE_DEPENDS ${gRPC_CPP_PLUGIN_EXECUTABLE})
list(APPEND PROTOBUF_COMMON_FLAGS
"--grpc_out=generate_mock_code=true:${GENERATED_PROTOBUF_PATH}"
--plugin=protoc-gen-grpc="${gRPC_CPP_PLUGIN_EXECUTABLE}")
@@ -284,7 +273,7 @@ add_custom_command(
${LOGS_PROTO} ${METRICS_PROTO} ${TRACE_SERVICE_PROTO} ${LOGS_SERVICE_PROTO}
${METRICS_SERVICE_PROTO} ${PROFILES_PROTO} ${PROFILES_SERVICE_PROTO}
COMMENT "[Run]: ${PROTOBUF_RUN_PROTOC_COMMAND}"
- DEPENDS ${PROTOBUF_PROTOC_EXECUTABLE})
+ DEPENDS ${PROTOBUF_GENERATE_DEPENDS})
unset(OTELCPP_PROTO_TARGET_OPTIONS)
if(CMAKE_SYSTEM_NAME MATCHES "Windows|MinGW|WindowsStore")
diff --git a/cmake/protobuf.cmake b/cmake/protobuf.cmake
new file mode 100644
index 0000000000..9bdcac91c0
--- /dev/null
+++ b/cmake/protobuf.cmake
@@ -0,0 +1,80 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+
+# Import Protobuf targets (protobuf::libprotobuf and protobuf::protoc) and set PROTOBUF_PROTOC_EXECUTABLE.
+# 1. If gRPC was fetched from github then use the Protobuf submodule built with gRPC
+# 2. Find an installed Protobuf package
+# 3. Use FetchContent to fetch and build Protobuf from GitHub
+
+if(DEFINED gRPC_PROVIDER AND NOT gRPC_PROVIDER STREQUAL "find_package" AND TARGET libprotobuf)
+ # gRPC was fetched and built Protobuf as a submodule
+
+ set(_Protobuf_VERSION_REGEX "\"cpp\"[ \t]*:[ \t]*\"([0-9]+\\.[0-9]+(\\.[0-9]+)?)\"")
+ set(_Protobuf_VERSION_FILE "${grpc_SOURCE_DIR}/third_party/protobuf/version.json")
+
+ file(READ "${_Protobuf_VERSION_FILE}" _Protobuf_VERSION_FILE_CONTENTS)
+ if(_Protobuf_VERSION_FILE_CONTENTS MATCHES ${_Protobuf_VERSION_REGEX})
+ set(Protobuf_VERSION "${CMAKE_MATCH_1}")
+ else()
+ message(WARNING "Failed to parse Protobuf version from ${_Protobuf_VERSION_FILE} using regex ${_Protobuf_VERSION_REGEX}")
+ endif()
+ set(Protobuf_PROVIDER "grpc_submodule")
+else()
+
+ # Search for an installed Protobuf package explicitly using the CONFIG search mode first followed by the MODULE search mode.
+ # Protobuf versions < 3.22.0 may be found using the module mode and some protobuf apt packages do not support the CONFIG search.
+
+ find_package(Protobuf CONFIG QUIET)
+ set(Protobuf_PROVIDER "find_package")
+
+ if(NOT Protobuf_FOUND)
+ find_package(Protobuf MODULE QUIET)
+ endif()
+
+ if(NOT Protobuf_FOUND)
+ FetchContent_Declare(
+ "protobuf"
+ GIT_REPOSITORY "https://github.com/protocolbuffers/protobuf.git"
+ GIT_TAG "${protobuf_GIT_TAG}"
+ )
+
+ set(protobuf_INSTALL ${OPENTELEMETRY_INSTALL} CACHE BOOL "" FORCE)
+ set(protobuf_BUILD_TESTS OFF CACHE BOOL "" FORCE)
+ set(protobuf_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
+
+ FetchContent_MakeAvailable(protobuf)
+
+ set(Protobuf_PROVIDER "fetch_repository")
+
+ # Set the Protobuf_VERSION variable from the git tag.
+ string(REGEX REPLACE "^v([0-9]+\\.[0-9]+\\.[0-9]+)$" "\\1" Protobuf_VERSION "${protobuf_GIT_TAG}")
+
+ if(TARGET libprotobuf)
+ set_target_properties(libprotobuf PROPERTIES POSITION_INDEPENDENT_CODE ON CXX_CLANG_TIDY "" CXX_INCLUDE_WHAT_YOU_USE "")
+ endif()
+
+ endif()
+endif()
+
+if(NOT TARGET protobuf::libprotobuf)
+ message(FATAL_ERROR "A required protobuf target (protobuf::libprotobuf) was not imported")
+endif()
+
+if(PROTOBUF_PROTOC_EXECUTABLE AND NOT Protobuf_PROTOC_EXECUTABLE)
+ message(WARNING "Use of PROTOBUF_PROTOC_EXECUTABLE is deprecated. Please use Protobuf_PROTOC_EXECUTABLE instead.")
+ set(Protobuf_PROTOC_EXECUTABLE "${PROTOBUF_PROTOC_EXECUTABLE}")
+endif()
+
+if(CMAKE_CROSSCOMPILING)
+ find_program(Protobuf_PROTOC_EXECUTABLE protoc)
+else()
+ if(NOT TARGET protobuf::protoc)
+ message(FATAL_ERROR "A required protobuf target (protobuf::protoc) was not imported")
+ endif()
+ set(Protobuf_PROTOC_EXECUTABLE "$")
+endif()
+
+set(PROTOBUF_PROTOC_EXECUTABLE "${Protobuf_PROTOC_EXECUTABLE}")
+
+message(STATUS "PROTOBUF_PROTOC_EXECUTABLE=${PROTOBUF_PROTOC_EXECUTABLE}")
diff --git a/cmake/zlib.cmake b/cmake/zlib.cmake
new file mode 100644
index 0000000000..ad616e0d28
--- /dev/null
+++ b/cmake/zlib.cmake
@@ -0,0 +1,20 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+# ZLIB must be found as an installed package for now.
+# Fetching ZLIB and building in-tree is not supported.
+# Protobuf, gRPC, prometheus-cpp, civetweb, CURL, and other dependencies require ZLIB and import its target.
+# When ZLIB::ZLIB is an alias of the shared library then inconsistent linking may occur.
+
+find_package(ZLIB REQUIRED)
+set(ZLIB_PROVIDER "find_package")
+
+# Set the ZLIB_VERSION from the legacy ZLIB_VERSION_STRING Required for CMake
+# versions below 3.26
+if(NOT ZLIB_VERSION AND ZLIB_VERSION_STRING)
+ set(ZLIB_VERSION ${ZLIB_VERSION_STRING})
+endif()
+
+if(NOT TARGET ZLIB::ZLIB)
+ message(FATAL_ERROR "The required zlib target (ZLIB::ZLIB) was not imported.")
+endif()
diff --git a/docs/dependencies.md b/docs/dependencies.md
index 8d19b6490b..78dbc4bb4d 100644
--- a/docs/dependencies.md
+++ b/docs/dependencies.md
@@ -6,6 +6,11 @@ There are
- Internal dependencies as the part of code from external libraries
backported/copied in main repo.
+The minimum required versions of the third-party libraries that are required can
+be found in the [third_party_minimum](/install/cmake/third_party_minimum) file.
+The minimum supported versions are listed here for convenience but the
+authoritative source is always the linked file.
+
Both these dependencies are listed here:
## Internal dependencies
@@ -37,8 +42,8 @@ Both these dependencies are listed here:
- [OTLP/HTTP+JSON](/exporters/otlp)
exporter:
- - [protobuf](https://github.com/protocolbuffers/protobuf): Library to
- serialize structured data.
+ - [protobuf](https://github.com/protocolbuffers/protobuf) (v3.21.6 or later):
+ Library to serialize structured data.
- OTLP messages are constructed as protobuf payloads.
- `protoc` compiler is used to generate C++ stubs for proto files provided
by `opentelemetry-proto`.
@@ -48,18 +53,19 @@ Both these dependencies are listed here:
[here](https://github.com/protocolbuffers/protobuf/blob/master/LICENSE).
The code generated by protoc compiler is owned by the owner of `.proto`
file.
- - [libcurl](https://curl.se/libcurl/) : the multiprotocol file transfer
- library.
+ - [libcurl](https://curl.se/libcurl/) (curl-7_81_0 or later):
+ the multiprotocol file transfer library.
- Export connects with opentelemetry collector over HTTP protocol using
libcurl library
- License: Inspired by `MIT/X` but not same.
- - [nlohmann/json](https://github.com/nlohmann/json): JSON for Modern C++.
+ - [nlohmann/json](https://github.com/nlohmann/json) (v3.10.5 or later):
+ JSON for Modern C++.
- protobuf serialized otlp messages are encoded in JSON format using this
library.
- License: `MIT License`
- - [zlib](https://www.zlib.net/): A Massively Spiffy Yet Delicately
- Unobtrusive Compression Library.
+ - [zlib](https://www.zlib.net/) (v1.2.11 or later):
+ A Massively Spiffy Yet Delicately Unobtrusive Compression Library.
- The `http_client` utilizes zlib to compress the message body and send
it in gzip format.
- License: The library is licensed
@@ -68,7 +74,7 @@ Both these dependencies are listed here:
- [OTLP/gRPC](/exporters/otlp)
exporter:
- `protobuf` OTLP messages are constructed as protobuf payloads.
- - [gRPC](https://github.com/grpc/grpc): An RPC library and framework
+ - [gRPC](https://github.com/grpc/grpc) (v1.49.2 or later): An RPC library and framework
- Exporter communicates with OTLP collector using gRPC transport mechanism.
- License: `Apache License 2.0`
@@ -84,8 +90,8 @@ Both these dependencies are listed here:
- [Prometheus](/exporters/prometheus)
exporter:
- - [`prometheus-cpp`](https://github.com/jupp0r/prometheus-cpp) Prometheus
- Client Library for Modern C++
+ - [`prometheus-cpp`](https://github.com/jupp0r/prometheus-cpp)
+ (v1.1.0 or later): Prometheus Client Library for Modern C++
- License: `MIT License`
- [ElasticSearch](/exporters/elasticsearch)
@@ -96,6 +102,6 @@ Both these dependencies are listed here:
- [Opentracing](/opentracing-shim)
shim:
- [`opentracing-cpp`](https://github.com/opentracing/opentracing-cpp)
- OpenTracing API for C++
+ (v1.6.0 or later): OpenTracing API for C++
- A bridge layer implementing the OpenTracing API using the OpenTelemetry API
- License: `Apache License 2.0`
diff --git a/examples/configuration/custom_log_record_exporter.cc b/examples/configuration/custom_log_record_exporter.cc
new file mode 100644
index 0000000000..c89faef021
--- /dev/null
+++ b/examples/configuration/custom_log_record_exporter.cc
@@ -0,0 +1,35 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#include "opentelemetry/sdk/common/global_log_handler.h"
+#include "opentelemetry/sdk/logs/read_write_log_record.h"
+#include "opentelemetry/sdk/logs/recordable.h"
+
+#include "custom_log_record_exporter.h"
+
+std::unique_ptr
+CustomLogRecordExporter::MakeRecordable() noexcept
+{
+ auto recordable = std::make_unique();
+ return recordable;
+}
+
+opentelemetry::sdk::common::ExportResult CustomLogRecordExporter::Export(
+ const opentelemetry::nostd::span>
+ & /* records */) noexcept
+{
+ OTEL_INTERNAL_LOG_ERROR("CustomLogRecordExporter::Export(): YOUR CODE HERE");
+ return opentelemetry::sdk::common::ExportResult::kSuccess;
+}
+
+bool CustomLogRecordExporter::ForceFlush(std::chrono::microseconds /* timeout */) noexcept
+{
+ OTEL_INTERNAL_LOG_ERROR("CustomLogRecordExporter::ForceFlush(): YOUR CODE HERE");
+ return false;
+}
+
+bool CustomLogRecordExporter::Shutdown(std::chrono::microseconds /* timeout */) noexcept
+{
+ OTEL_INTERNAL_LOG_ERROR("CustomLogRecordExporter::Shutdown(): YOUR CODE HERE");
+ return false;
+}
diff --git a/examples/configuration/custom_log_record_exporter.h b/examples/configuration/custom_log_record_exporter.h
new file mode 100644
index 0000000000..b3a19c5569
--- /dev/null
+++ b/examples/configuration/custom_log_record_exporter.h
@@ -0,0 +1,37 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#pragma once
+
+#include
+#include
+#include
+
+#include "opentelemetry/nostd/span.h"
+#include "opentelemetry/sdk/common/exporter_utils.h"
+#include "opentelemetry/sdk/logs/exporter.h"
+#include "opentelemetry/sdk/logs/recordable.h"
+
+class CustomLogRecordExporter : public opentelemetry::sdk::logs::LogRecordExporter
+{
+public:
+ CustomLogRecordExporter(const std::string &comment) : comment_(comment) {}
+ CustomLogRecordExporter(CustomLogRecordExporter &&) = delete;
+ CustomLogRecordExporter(const CustomLogRecordExporter &) = delete;
+ CustomLogRecordExporter &operator=(CustomLogRecordExporter &&) = delete;
+ CustomLogRecordExporter &operator=(const CustomLogRecordExporter &other) = delete;
+ ~CustomLogRecordExporter() override = default;
+
+ std::unique_ptr MakeRecordable() noexcept override;
+
+ opentelemetry::sdk::common::ExportResult Export(
+ const opentelemetry::nostd::span>
+ &records) noexcept override;
+
+ bool ForceFlush(std::chrono::microseconds timeout) noexcept override;
+
+ bool Shutdown(std::chrono::microseconds timeout) noexcept override;
+
+private:
+ std::string comment_;
+};
diff --git a/examples/configuration/custom_log_record_exporter_builder.cc b/examples/configuration/custom_log_record_exporter_builder.cc
new file mode 100644
index 0000000000..fab5f9f1a6
--- /dev/null
+++ b/examples/configuration/custom_log_record_exporter_builder.cc
@@ -0,0 +1,31 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#include
+#include
+
+#include "opentelemetry/sdk/configuration/document_node.h"
+#include "opentelemetry/sdk/configuration/extension_log_record_exporter_configuration.h"
+#include "opentelemetry/sdk/configuration/registry.h"
+#include "opentelemetry/sdk/logs/exporter.h"
+
+#include "custom_log_record_exporter.h"
+#include "custom_log_record_exporter_builder.h"
+
+std::unique_ptr CustomLogRecordExporterBuilder::Build(
+ const opentelemetry::sdk::configuration::ExtensionLogRecordExporterConfiguration *model) const
+{
+ // Read yaml attributes
+ std::string comment = model->node->GetRequiredString("comment");
+
+ auto sdk = std::make_unique(comment);
+
+ return sdk;
+}
+
+void CustomLogRecordExporterBuilder::Register(opentelemetry::sdk::configuration::Registry *registry)
+{
+ auto builder = std::make_unique();
+ registry->SetExtensionLogRecordExporterBuilder("my_custom_log_record_exporter",
+ std::move(builder));
+}
diff --git a/examples/configuration/custom_log_record_exporter_builder.h b/examples/configuration/custom_log_record_exporter_builder.h
new file mode 100644
index 0000000000..b360bc0955
--- /dev/null
+++ b/examples/configuration/custom_log_record_exporter_builder.h
@@ -0,0 +1,22 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#pragma once
+
+#include
+
+#include "opentelemetry/sdk/configuration/extension_log_record_exporter_builder.h"
+#include "opentelemetry/sdk/configuration/extension_log_record_exporter_configuration.h"
+#include "opentelemetry/sdk/configuration/registry.h"
+#include "opentelemetry/sdk/logs/exporter.h"
+
+class CustomLogRecordExporterBuilder
+ : public opentelemetry::sdk::configuration::ExtensionLogRecordExporterBuilder
+{
+public:
+ static void Register(opentelemetry::sdk::configuration::Registry *registry);
+
+ std::unique_ptr Build(
+ const opentelemetry::sdk::configuration::ExtensionLogRecordExporterConfiguration *model)
+ const override;
+};
diff --git a/examples/configuration/custom_log_record_processor.cc b/examples/configuration/custom_log_record_processor.cc
new file mode 100644
index 0000000000..be9716022a
--- /dev/null
+++ b/examples/configuration/custom_log_record_processor.cc
@@ -0,0 +1,36 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#include
+
+#include "opentelemetry/sdk/common/global_log_handler.h"
+#include "opentelemetry/sdk/logs/read_write_log_record.h"
+#include "opentelemetry/sdk/logs/recordable.h"
+
+#include "custom_log_record_processor.h"
+
+std::unique_ptr
+CustomLogRecordProcessor::MakeRecordable() noexcept
+{
+ auto recordable = std::make_unique();
+ return recordable;
+}
+
+void CustomLogRecordProcessor::OnEmit(
+ std::unique_ptr &&span) noexcept
+{
+ OTEL_INTERNAL_LOG_ERROR("CustomLogRecordProcessor::OnEnd(): YOUR CODE HERE");
+ auto unused = std::move(span);
+}
+
+bool CustomLogRecordProcessor::ForceFlush(std::chrono::microseconds /* timeout */) noexcept
+{
+ OTEL_INTERNAL_LOG_ERROR("CustomLogRecordProcessor::ForceFlush(): YOUR CODE HERE");
+ return false;
+}
+
+bool CustomLogRecordProcessor::Shutdown(std::chrono::microseconds /* timeout */) noexcept
+{
+ OTEL_INTERNAL_LOG_ERROR("CustomLogRecordProcessor::Shutdown(): YOUR CODE HERE");
+ return false;
+}
diff --git a/examples/configuration/custom_log_record_processor.h b/examples/configuration/custom_log_record_processor.h
new file mode 100644
index 0000000000..81e6125bd0
--- /dev/null
+++ b/examples/configuration/custom_log_record_processor.h
@@ -0,0 +1,33 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#pragma once
+
+#include
+#include
+#include
+
+#include "opentelemetry/sdk/logs/processor.h"
+#include "opentelemetry/sdk/logs/recordable.h"
+
+class CustomLogRecordProcessor : public opentelemetry::sdk::logs::LogRecordProcessor
+{
+public:
+ CustomLogRecordProcessor(const std::string &comment) : comment_(comment) {}
+ CustomLogRecordProcessor(CustomLogRecordProcessor &&) = delete;
+ CustomLogRecordProcessor(const CustomLogRecordProcessor &) = delete;
+ CustomLogRecordProcessor &operator=(CustomLogRecordProcessor &&) = delete;
+ CustomLogRecordProcessor &operator=(const CustomLogRecordProcessor &other) = delete;
+ ~CustomLogRecordProcessor() override = default;
+
+ std::unique_ptr MakeRecordable() noexcept override;
+
+ void OnEmit(std::unique_ptr &&record) noexcept override;
+
+ bool ForceFlush(std::chrono::microseconds timeout) noexcept override;
+
+ bool Shutdown(std::chrono::microseconds timeout) noexcept override;
+
+private:
+ std::string comment_;
+};
diff --git a/examples/configuration/custom_log_record_processor_builder.cc b/examples/configuration/custom_log_record_processor_builder.cc
new file mode 100644
index 0000000000..ceff65e6f3
--- /dev/null
+++ b/examples/configuration/custom_log_record_processor_builder.cc
@@ -0,0 +1,33 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#include
+#include
+
+#include "opentelemetry/sdk/configuration/document_node.h"
+#include "opentelemetry/sdk/configuration/extension_log_record_processor_configuration.h"
+#include "opentelemetry/sdk/configuration/registry.h"
+#include "opentelemetry/sdk/logs/processor.h"
+
+#include "custom_log_record_processor.h"
+#include "custom_log_record_processor_builder.h"
+
+std::unique_ptr
+CustomLogRecordProcessorBuilder::Build(
+ const opentelemetry::sdk::configuration::ExtensionLogRecordProcessorConfiguration *model) const
+{
+ // Read yaml attributes
+ std::string comment = model->node->GetRequiredString("comment");
+
+ auto sdk = std::make_unique(comment);
+
+ return sdk;
+}
+
+void CustomLogRecordProcessorBuilder::Register(
+ opentelemetry::sdk::configuration::Registry *registry)
+{
+ auto builder = std::make_unique();
+ registry->SetExtensionLogRecordProcessorBuilder("my_custom_log_record_processor",
+ std::move(builder));
+}
diff --git a/examples/configuration/custom_log_record_processor_builder.h b/examples/configuration/custom_log_record_processor_builder.h
new file mode 100644
index 0000000000..14d6663ead
--- /dev/null
+++ b/examples/configuration/custom_log_record_processor_builder.h
@@ -0,0 +1,22 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#pragma once
+
+#include
+
+#include "opentelemetry/sdk/configuration/extension_log_record_processor_builder.h"
+#include "opentelemetry/sdk/configuration/extension_log_record_processor_configuration.h"
+#include "opentelemetry/sdk/configuration/registry.h"
+#include "opentelemetry/sdk/logs/processor.h"
+
+class CustomLogRecordProcessorBuilder
+ : public opentelemetry::sdk::configuration::ExtensionLogRecordProcessorBuilder
+{
+public:
+ static void Register(opentelemetry::sdk::configuration::Registry *registry);
+
+ std::unique_ptr Build(
+ const opentelemetry::sdk::configuration::ExtensionLogRecordProcessorConfiguration *model)
+ const override;
+};
diff --git a/examples/configuration/custom_pull_metric_exporter.cc b/examples/configuration/custom_pull_metric_exporter.cc
new file mode 100644
index 0000000000..da542731a7
--- /dev/null
+++ b/examples/configuration/custom_pull_metric_exporter.cc
@@ -0,0 +1,31 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#include "opentelemetry/sdk/common/global_log_handler.h"
+
+#include "custom_pull_metric_exporter.h"
+
+opentelemetry::sdk::metrics::AggregationTemporality
+CustomPullMetricExporter::GetAggregationTemporality(
+ opentelemetry::sdk::metrics::InstrumentType /* instrument_type */) const noexcept
+{
+ OTEL_INTERNAL_LOG_ERROR("CustomPullMetricExporter::GetAggregationTemporality(): YOUR CODE HERE");
+ return opentelemetry::sdk::metrics::AggregationTemporality::kCumulative;
+}
+
+bool CustomPullMetricExporter::OnForceFlush(std::chrono::microseconds /* timeout */) noexcept
+{
+ OTEL_INTERNAL_LOG_ERROR("CustomPullMetricExporter::OnForceFlush(): YOUR CODE HERE");
+ return true;
+}
+
+bool CustomPullMetricExporter::OnShutDown(std::chrono::microseconds /* timeout */) noexcept
+{
+ OTEL_INTERNAL_LOG_ERROR("CustomPullMetricExporter::OnShutDown(): YOUR CODE HERE");
+ return true;
+}
+
+void CustomPullMetricExporter::OnInitialized() noexcept
+{
+ OTEL_INTERNAL_LOG_ERROR("CustomPullMetricExporter::OnInitialized(): YOUR CODE HERE");
+}
diff --git a/examples/configuration/custom_pull_metric_exporter.h b/examples/configuration/custom_pull_metric_exporter.h
new file mode 100644
index 0000000000..debefdf4a1
--- /dev/null
+++ b/examples/configuration/custom_pull_metric_exporter.h
@@ -0,0 +1,33 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#pragma once
+
+#include
+#include
+
+#include "opentelemetry/sdk/metrics/instruments.h"
+#include "opentelemetry/sdk/metrics/metric_reader.h"
+
+class CustomPullMetricExporter : public opentelemetry::sdk::metrics::MetricReader
+{
+public:
+ CustomPullMetricExporter(const std::string &comment) : comment_(comment) {}
+ CustomPullMetricExporter(CustomPullMetricExporter &&) = delete;
+ CustomPullMetricExporter(const CustomPullMetricExporter &) = delete;
+ CustomPullMetricExporter &operator=(CustomPullMetricExporter &&) = delete;
+ CustomPullMetricExporter &operator=(const CustomPullMetricExporter &other) = delete;
+ ~CustomPullMetricExporter() override = default;
+
+ opentelemetry::sdk::metrics::AggregationTemporality GetAggregationTemporality(
+ opentelemetry::sdk::metrics::InstrumentType instrument_type) const noexcept override;
+
+ bool OnForceFlush(std::chrono::microseconds timeout) noexcept override;
+
+ bool OnShutDown(std::chrono::microseconds timeout) noexcept override;
+
+ void OnInitialized() noexcept override;
+
+private:
+ std::string comment_;
+};
diff --git a/examples/configuration/custom_pull_metric_exporter_builder.cc b/examples/configuration/custom_pull_metric_exporter_builder.cc
new file mode 100644
index 0000000000..480a1ff60a
--- /dev/null
+++ b/examples/configuration/custom_pull_metric_exporter_builder.cc
@@ -0,0 +1,32 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#include
+#include
+
+#include "opentelemetry/sdk/configuration/document_node.h"
+#include "opentelemetry/sdk/configuration/extension_pull_metric_exporter_configuration.h"
+#include "opentelemetry/sdk/configuration/registry.h"
+#include "opentelemetry/sdk/metrics/metric_reader.h"
+
+#include "custom_pull_metric_exporter.h"
+#include "custom_pull_metric_exporter_builder.h"
+
+std::unique_ptr CustomPullMetricExporterBuilder::Build(
+ const opentelemetry::sdk::configuration::ExtensionPullMetricExporterConfiguration *model) const
+{
+ // Read yaml attributes
+ std::string comment = model->node->GetRequiredString("comment");
+
+ auto sdk = std::make_unique(comment);
+
+ return sdk;
+}
+
+void CustomPullMetricExporterBuilder::Register(
+ opentelemetry::sdk::configuration::Registry *registry)
+{
+ auto builder = std::make_unique();
+ registry->SetExtensionPullMetricExporterBuilder("my_custom_pull_metric_exporter",
+ std::move(builder));
+}
diff --git a/examples/configuration/custom_pull_metric_exporter_builder.h b/examples/configuration/custom_pull_metric_exporter_builder.h
new file mode 100644
index 0000000000..94a1458b6f
--- /dev/null
+++ b/examples/configuration/custom_pull_metric_exporter_builder.h
@@ -0,0 +1,22 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#pragma once
+
+#include
+
+#include "opentelemetry/sdk/configuration/extension_pull_metric_exporter_builder.h"
+#include "opentelemetry/sdk/configuration/extension_pull_metric_exporter_configuration.h"
+#include "opentelemetry/sdk/configuration/registry.h"
+#include "opentelemetry/sdk/metrics/metric_reader.h"
+
+class CustomPullMetricExporterBuilder
+ : public opentelemetry::sdk::configuration::ExtensionPullMetricExporterBuilder
+{
+public:
+ static void Register(opentelemetry::sdk::configuration::Registry *registry);
+
+ std::unique_ptr Build(
+ const opentelemetry::sdk::configuration::ExtensionPullMetricExporterConfiguration *model)
+ const override;
+};
diff --git a/examples/configuration/custom_push_metric_exporter.cc b/examples/configuration/custom_push_metric_exporter.cc
new file mode 100644
index 0000000000..19aad75416
--- /dev/null
+++ b/examples/configuration/custom_push_metric_exporter.cc
@@ -0,0 +1,34 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#include "opentelemetry/sdk/common/global_log_handler.h"
+#include "opentelemetry/sdk/metrics/push_metric_exporter.h"
+
+#include "custom_push_metric_exporter.h"
+
+opentelemetry::sdk::common::ExportResult CustomPushMetricExporter::Export(
+ const opentelemetry::sdk::metrics::ResourceMetrics & /* data */) noexcept
+{
+ OTEL_INTERNAL_LOG_ERROR("CustomPushMetricExporter::Export(): YOUR CODE HERE");
+ return opentelemetry::sdk::common::ExportResult::kSuccess;
+}
+
+opentelemetry::sdk::metrics::AggregationTemporality
+CustomPushMetricExporter::GetAggregationTemporality(
+ opentelemetry::sdk::metrics::InstrumentType /* instrument_type */) const noexcept
+{
+ OTEL_INTERNAL_LOG_ERROR("CustomPushMetricExporter::GetAggregationTemporality(): YOUR CODE HERE");
+ return opentelemetry::sdk::metrics::AggregationTemporality::kCumulative;
+}
+
+bool CustomPushMetricExporter::ForceFlush(std::chrono::microseconds /* timeout */) noexcept
+{
+ OTEL_INTERNAL_LOG_ERROR("CustomPushMetricExporter::ForceFlush(): YOUR CODE HERE");
+ return true;
+}
+
+bool CustomPushMetricExporter::Shutdown(std::chrono::microseconds /* timeout */) noexcept
+{
+ OTEL_INTERNAL_LOG_ERROR("CustomPushMetricExporter::Shutdown(): YOUR CODE HERE");
+ return true;
+}
diff --git a/examples/configuration/custom_push_metric_exporter.h b/examples/configuration/custom_push_metric_exporter.h
new file mode 100644
index 0000000000..f5222c343c
--- /dev/null
+++ b/examples/configuration/custom_push_metric_exporter.h
@@ -0,0 +1,35 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#pragma once
+
+#include
+#include
+
+#include "opentelemetry/sdk/common/exporter_utils.h"
+#include "opentelemetry/sdk/metrics/instruments.h"
+#include "opentelemetry/sdk/metrics/push_metric_exporter.h"
+
+class CustomPushMetricExporter : public opentelemetry::sdk::metrics::PushMetricExporter
+{
+public:
+ CustomPushMetricExporter(const std::string &comment) : comment_(comment) {}
+ CustomPushMetricExporter(CustomPushMetricExporter &&) = delete;
+ CustomPushMetricExporter(const CustomPushMetricExporter &) = delete;
+ CustomPushMetricExporter &operator=(CustomPushMetricExporter &&) = delete;
+ CustomPushMetricExporter &operator=(const CustomPushMetricExporter &other) = delete;
+ ~CustomPushMetricExporter() override = default;
+
+ opentelemetry::sdk::common::ExportResult Export(
+ const opentelemetry::sdk::metrics::ResourceMetrics &data) noexcept override;
+
+ opentelemetry::sdk::metrics::AggregationTemporality GetAggregationTemporality(
+ opentelemetry::sdk::metrics::InstrumentType instrument_type) const noexcept override;
+
+ bool ForceFlush(std::chrono::microseconds timeout) noexcept override;
+
+ bool Shutdown(std::chrono::microseconds timeout) noexcept override;
+
+private:
+ std::string comment_;
+};
diff --git a/examples/configuration/custom_push_metric_exporter_builder.cc b/examples/configuration/custom_push_metric_exporter_builder.cc
new file mode 100644
index 0000000000..c2e76c8036
--- /dev/null
+++ b/examples/configuration/custom_push_metric_exporter_builder.cc
@@ -0,0 +1,33 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#include
+#include
+
+#include "opentelemetry/sdk/configuration/document_node.h"
+#include "opentelemetry/sdk/configuration/extension_push_metric_exporter_configuration.h"
+#include "opentelemetry/sdk/configuration/registry.h"
+#include "opentelemetry/sdk/metrics/push_metric_exporter.h"
+
+#include "custom_push_metric_exporter.h"
+#include "custom_push_metric_exporter_builder.h"
+
+std::unique_ptr
+CustomPushMetricExporterBuilder::Build(
+ const opentelemetry::sdk::configuration::ExtensionPushMetricExporterConfiguration *model) const
+{
+ // Read yaml attributes
+ std::string comment = model->node->GetRequiredString("comment");
+
+ auto sdk = std::make_unique(comment);
+
+ return sdk;
+}
+
+void CustomPushMetricExporterBuilder::Register(
+ opentelemetry::sdk::configuration::Registry *registry)
+{
+ auto builder = std::make_unique();
+ registry->SetExtensionPushMetricExporterBuilder("my_custom_push_metric_exporter",
+ std::move(builder));
+}
diff --git a/examples/configuration/custom_push_metric_exporter_builder.h b/examples/configuration/custom_push_metric_exporter_builder.h
new file mode 100644
index 0000000000..c5ff2fe33f
--- /dev/null
+++ b/examples/configuration/custom_push_metric_exporter_builder.h
@@ -0,0 +1,22 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#pragma once
+
+#include
+
+#include "opentelemetry/sdk/configuration/extension_push_metric_exporter_builder.h"
+#include "opentelemetry/sdk/configuration/extension_push_metric_exporter_configuration.h"
+#include "opentelemetry/sdk/configuration/registry.h"
+#include "opentelemetry/sdk/metrics/push_metric_exporter.h"
+
+class CustomPushMetricExporterBuilder
+ : public opentelemetry::sdk::configuration::ExtensionPushMetricExporterBuilder
+{
+public:
+ static void Register(opentelemetry::sdk::configuration::Registry *registry);
+
+ std::unique_ptr Build(
+ const opentelemetry::sdk::configuration::ExtensionPushMetricExporterConfiguration *model)
+ const override;
+};
diff --git a/examples/configuration/custom_sampler.cc b/examples/configuration/custom_sampler.cc
new file mode 100644
index 0000000000..1957e8175a
--- /dev/null
+++ b/examples/configuration/custom_sampler.cc
@@ -0,0 +1,35 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#include