Skip to content

[CONFIGURATION] Implement declarative configuration (config.yaml) #2518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 238 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
238 commits
Select commit Hold shift + click to select a range
636b85c
POC
marcalff Jan 23, 2024
b90ce1c
POC
marcalff Jan 24, 2024
1532b26
POC. Abstracted parsing from YAML.
marcalff Jan 25, 2024
34b8575
POC, continued.
marcalff Jan 28, 2024
da2f173
POC, trace signal.
marcalff Jan 28, 2024
04f2f6f
POC, continued.
marcalff Jan 31, 2024
90e6418
POC, yaml tests.
marcalff Jan 31, 2024
469bc0e
POC
marcalff Feb 1, 2024
8af0eed
POC, continued.
marcalff Feb 2, 2024
1f9a90c
Merge branch 'main' into poc_config_yaml
marcalff Feb 5, 2024
de49146
CI
marcalff Feb 5, 2024
9d12c76
POC - Registry
marcalff Feb 6, 2024
083e9f1
Code cleanup
marcalff Feb 7, 2024
11a51d8
POC, continued.
marcalff Feb 8, 2024
aa21bd6
POC - propagators
marcalff Feb 11, 2024
853c696
POC - text map propagetors
marcalff Feb 11, 2024
bc394cf
POC - cleanup
marcalff Feb 12, 2024
c8c1668
POC - replacing Yaml-cpp with Rapidyaml
marcalff Feb 15, 2024
7c81b0b
POC - replace Yaml-cpp with Ryml
marcalff Feb 17, 2024
df13b50
Merge branch 'main' into poc_config_yaml
marcalff Feb 17, 2024
eb1155d
POC - CI
marcalff Feb 17, 2024
172e212
CI
marcalff Feb 18, 2024
09d8122
CI
marcalff Feb 18, 2024
e537287
Cleanup
marcalff Feb 18, 2024
5351d20
POC - Implemented extension points (sampler, span processor, span exp…
marcalff Feb 20, 2024
fde1025
CMakeFormat
marcalff Feb 20, 2024
3c0465f
POC - env var substitution
marcalff Feb 25, 2024
0bfbe8f
Merge branch 'main' into poc_config_yaml
marcalff Feb 25, 2024
d147b62
Add yaml test cases
marcalff Feb 25, 2024
5d65ac2
POC - Now starting on metrics
marcalff Feb 28, 2024
ee0cc1e
env var substitution, with unit tests.
marcalff Feb 29, 2024
91fccb3
CI cleanup
marcalff Mar 2, 2024
ecf6f1c
Remove service_name, per configuration PR 68
marcalff Mar 4, 2024
9987f23
YAML parser for metrics
marcalff Mar 5, 2024
2a76bda
Merge branch 'main' into poc_config_yaml
marcalff Mar 8, 2024
62f0d35
WIP
marcalff Apr 3, 2024
1d8d0d0
Merge branch 'main' into poc_config_yaml
marcalff Apr 3, 2024
3a431c7
Merge branch 'main' into poc_config_yaml
marcalff Apr 19, 2024
b33fc82
Fixed shellcheck issues.
marcalff Apr 19, 2024
1960d29
Fix CI after merge.
marcalff Apr 19, 2024
c3db04b
Merge branch 'main' into poc_config_yaml
marcalff Apr 27, 2024
92a6849
Merge branch 'main' into poc_config_yaml
marcalff Apr 29, 2024
4765975
Merge branch 'main' into poc_config_yaml
marcalff May 14, 2024
4bb5fe4
Remove all code for yaml-cpp
marcalff May 14, 2024
1b2fcf4
Merge branch 'main' into poc_config_yaml
marcalff May 29, 2024
559153c
include-what-you-use to cover WITH_CONFIGURATION
marcalff May 30, 2024
c199ff9
Add rapidyaml in iwyu
marcalff May 30, 2024
c463d8e
Merge branch 'main' into poc_config_yaml
marcalff May 30, 2024
2c8d8a7
Merge branch 'main' into poc_config_yaml
marcalff Jun 1, 2024
f86e9a7
Log signal
marcalff Jun 1, 2024
5ee15b5
Merge branch 'main' into poc_config_yaml
marcalff Jun 7, 2024
932e26e
WIP
marcalff Jun 7, 2024
5ff727d
Merge branch 'main' into poc_config_yaml
marcalff Jun 12, 2024
cc95c00
Adjust after merge from main
marcalff Jun 12, 2024
8c4330b
Use clang 18
marcalff Jun 12, 2024
87a62f7
Merge branch 'main' into poc_config_yaml
marcalff Jun 25, 2024
84dda0e
build cleanup
marcalff Jun 25, 2024
9d3c36a
cleanup
marcalff Jun 26, 2024
fc24357
cleanup
marcalff Jun 27, 2024
179444c
build cleanup
marcalff Jun 27, 2024
2a5fc7b
build cleanup
marcalff Jun 27, 2024
fcaea7f
warning cleanup
marcalff Jun 27, 2024
d25ead0
build cleanup, deprecated code
marcalff Jun 27, 2024
c8d3980
build warnings
marcalff Jun 27, 2024
98752aa
Merge branch 'main' into poc_config_yaml
marcalff Jul 6, 2024
ab95a6b
include-what-you-use cleanup
marcalff Jul 6, 2024
dfcdc87
more iwyu cleanup
marcalff Jul 6, 2024
6007bd4
Continue log record implementation.
marcalff Jul 6, 2024
cbbe913
Cleanup
marcalff Jul 9, 2024
075b27a
Expanded variable substitution.
marcalff Jul 9, 2024
52234d0
Fixed build warning.
marcalff Jul 10, 2024
9a8b829
Merge branch 'main' into poc_config_yaml
marcalff Jul 17, 2024
e4ff2c4
Cleanup after merge.
marcalff Jul 17, 2024
a42704d
Fix clang-tidy
marcalff Jul 17, 2024
75758a5
Merge branch 'main' into poc_config_yaml
marcalff Jul 29, 2024
d3a9986
cleanup
marcalff Jul 30, 2024
6ac6fe2
Continued.
marcalff Aug 3, 2024
a3e5e05
format
marcalff Aug 3, 2024
560fa50
Merge branch 'main' into poc_config_yaml
marcalff Aug 3, 2024
c6f1503
Implemented builder for metrics (in progress)
marcalff Aug 4, 2024
a768f8d
Split MetricExporterConfiguration into:
marcalff Aug 4, 2024
1f7110e
Add prometheus exporter builder
marcalff Aug 5, 2024
a204780
Add metric builders: console and otlp
marcalff Aug 5, 2024
86a0b3b
Build cleanup
marcalff Aug 7, 2024
15fec29
Build cleanup for resource
marcalff Aug 7, 2024
466f541
Split OTLP builders into:
marcalff Aug 10, 2024
44d86f0
Merge branch 'main' into poc_config_yaml
marcalff Aug 10, 2024
2c15009
cleanup
marcalff Aug 10, 2024
4076d43
Merge branch 'main' into poc_config_yaml
marcalff Aug 24, 2024
87b034b
Require ryml 0.7.1
marcalff Aug 25, 2024
8ee0dba
Merge branch 'main' into poc_config_yaml
marcalff Aug 25, 2024
9e71e01
Use ryml 0.7.1 in CI
marcalff Aug 25, 2024
51c7ee0
Work around for broken ryml tag v0.7.1
marcalff Aug 25, 2024
4c964fd
Implemented resource schema changes.
marcalff Aug 26, 2024
b11105d
Merge branch 'main' into poc_config_yaml
marcalff Aug 26, 2024
10f1bc2
Upgrade to ryml 0.7.2
marcalff Aug 28, 2024
cb9e0d0
Merge branch 'main' into poc_config_yaml
marcalff Sep 14, 2024
96bf29b
Merge branch 'main' into poc_config_yaml
marcalff Oct 31, 2024
b6fcc19
Merge branch 'main' into poc_config_yaml
marcalff Nov 8, 2024
75e3816
WIP
marcalff Nov 20, 2024
b7b66ec
Merge branch 'main' into poc_config_yaml
marcalff Nov 20, 2024
a1471e0
Merge branch 'main' into poc_config_yaml
marcalff Nov 28, 2024
a020ef9
Merge branch 'main' into poc_config_yaml
marcalff Dec 3, 2024
be9d57d
General cleanup.
marcalff Dec 3, 2024
54d7b1e
WIP
marcalff Dec 7, 2024
5e5fb5c
Merge branch 'main' into poc_config_yaml
marcalff Dec 7, 2024
d2f6c6e
Cppcheck cleanup
marcalff Dec 7, 2024
faf756f
Cppcheck
marcalff Dec 7, 2024
2d4388d
Merge branch 'main' into poc_config_yaml
marcalff Dec 8, 2024
2cfdc09
iwyu cleanup
marcalff Dec 10, 2024
3b58494
cleanup
marcalff Dec 17, 2024
8420c89
Merge branch 'main' into poc_config_yaml
marcalff Dec 17, 2024
9fe6f87
Merge branch 'main' into poc_config_yaml
marcalff Jan 9, 2025
8679b5e
iwyu
marcalff Jan 9, 2025
f010853
Merge branch 'main' into poc_config_yaml
marcalff Jan 14, 2025
071336c
Merge branch 'main' into poc_config_yaml
marcalff Jan 29, 2025
c35fc96
merge cleanup
marcalff Jan 29, 2025
02a7236
Merge branch 'main' into poc_config_yaml
marcalff Feb 5, 2025
88d0888
Merge branch 'main' into poc_config_yaml
marcalff Mar 4, 2025
8933501
Split otlp into otlp_http and otlp_grpc
marcalff Mar 5, 2025
62b431b
Merge branch 'main' into poc_config_yaml
marcalff Mar 5, 2025
11bbcac
Upgrade to format 0.3 (in progress)
marcalff Mar 6, 2025
dbb1921
Add missing file
marcalff Mar 10, 2025
99704a4
Cleanup
marcalff Mar 11, 2025
d63e205
Merge branch 'main' into poc_config_yaml
marcalff Mar 20, 2025
8284606
Preparing for code review.
marcalff Mar 20, 2025
ede6760
CI cleanup
marcalff Mar 20, 2025
0866d9c
Merge branch 'main' into poc_config_yaml
marcalff Mar 24, 2025
314ac94
Merge branch 'main' into poc_config_yaml
ThomsonTan Mar 25, 2025
e1dad42
Merge branch 'main' into poc_config_yaml
marcalff Mar 25, 2025
3148298
Merge branch 'main' into poc_config_yaml
ThomsonTan Mar 28, 2025
6a32c8e
Merge branch 'main' into poc_config_yaml
marcalff Apr 2, 2025
195061c
Merge branch 'main' into poc_config_yaml
marcalff May 26, 2025
43a425f
format
marcalff May 26, 2025
4d2e53f
Added support for otlp_file
marcalff May 28, 2025
e02c6bc
fix iwyu
marcalff May 28, 2025
496e542
Merge branch 'main' into poc_config_yaml
marcalff May 28, 2025
1feda7c
Merge branch 'main' into poc_config_yaml
marcalff Jun 8, 2025
4cb7089
Upgrade ryml to 0.9.0
marcalff Jun 8, 2025
7e5f853
Merge branch 'main' into poc_config_yaml
marcalff Jun 9, 2025
d61edcd
cleanup
marcalff Jun 9, 2025
2f52604
fix iwyu
marcalff Jun 9, 2025
adba7de
Code review comments, part 1
marcalff Jun 10, 2025
335e103
Merge branch 'main' into poc_config_yaml
marcalff Jun 26, 2025
4bdb337
clang-tidy cleanup
marcalff Jun 26, 2025
1142924
Merge branch 'main' into poc_config_yaml
marcalff Jun 26, 2025
2045397
clang-tidy
marcalff Jun 26, 2025
1576f56
cleanup for clang-tidy, build break.
marcalff Jun 26, 2025
182fbb2
Cleanup, continued.
marcalff Jun 27, 2025
b77d095
Merge branch 'main' into poc_config_yaml
marcalff Jun 27, 2025
343d723
more clang-tidy cleanup
marcalff Jun 27, 2025
c0f37ab
cleanup
marcalff Jun 27, 2025
6a771b0
Merge branch 'main' into poc_config_yaml
marcalff Jun 27, 2025
453c01b
Merge branch 'main' into poc_config_yaml
marcalff Jun 27, 2025
fbb5b98
Misc fixes
marcalff Jun 27, 2025
b7127e3
iwyu cleanup
marcalff Jun 28, 2025
0d92997
Merge branch 'main' into poc_config_yaml
marcalff Jun 28, 2025
87b267d
merge cleanup
marcalff Jun 29, 2025
0aa583e
format
marcalff Jun 29, 2025
f0955ba
Merge branch 'main' into poc_config_yaml
marcalff Jul 1, 2025
54e5544
Attribute Value parsing for resources.
marcalff Jul 1, 2025
6364dc6
cleanup
marcalff Jul 1, 2025
182ef49
sdk resources
marcalff Jul 2, 2025
1a60954
iwyu cleanup
marcalff Jul 2, 2025
fdecea6
Merge branch 'main' into poc_config_yaml
marcalff Jul 4, 2025
bb36472
Review comments, fix enum classes
marcalff Jul 4, 2025
9ffcee1
Code review comments.
marcalff Jul 4, 2025
8ae27fd
Code review comments
marcalff Jul 6, 2025
2a212a3
Merge branch 'main' into poc_config_yaml
marcalff Jul 6, 2025
dc20db2
Merge branch 'main' into poc_config_yaml
marcalff Jul 6, 2025
3abfd3f
Add trace unit tests.
marcalff Jul 6, 2025
22e31b4
cleanup
marcalff Jul 7, 2025
038cbce
Parser yaml tests
marcalff Jul 7, 2025
32e408a
include-what-you-use
marcalff Jul 7, 2025
6a29200
Code review comments, more parser tests.
marcalff Jul 8, 2025
7583bf8
build cleanup
marcalff Jul 9, 2025
4482b08
Merge branch 'main' into poc_config_yaml
marcalff Jul 9, 2025
caa8f9d
Build warnings cleanup
marcalff Jul 9, 2025
6bb6e47
Code review comments, continued.
marcalff Jul 9, 2025
fe155fb
iwyu
marcalff Jul 9, 2025
0c1d3a3
Code review comments:
marcalff Jul 10, 2025
4125d9f
Cleanup
marcalff Jul 10, 2025
d25ef85
Merge branch 'main' into poc_config_yaml
marcalff Jul 11, 2025
74ed357
Expand extension points examples.
marcalff Jul 13, 2025
68c8dee
Merge branch 'main' into poc_config_yaml
marcalff Jul 13, 2025
f3d01cf
Cleanup
marcalff Jul 13, 2025
5e0ce46
Implement metric view aggregation
marcalff Jul 14, 2025
6054b9d
Cleanup
marcalff Jul 14, 2025
8919a49
Code review comments, continued.
marcalff Jul 15, 2025
ff04475
Code review comments, registry.
marcalff Jul 15, 2025
069abe9
Cleanup
marcalff Jul 15, 2025
56def2c
iwyu
marcalff Jul 15, 2025
2c65020
Fix merge with ci changes
marcalff Jul 15, 2025
b2d96de
iwyu
marcalff Jul 15, 2025
7f029f4
Merge branch 'main' into poc_config_yaml
marcalff Jul 15, 2025
724d1b0
Reference existing issue when known
marcalff Jul 17, 2025
fb479d7
Merge branch 'main' into poc_config_yaml
marcalff Jul 17, 2025
30df255
Code cleanup
marcalff Jul 17, 2025
e692852
build warnings cleanup
marcalff Jul 17, 2025
62e793b
cleanup
marcalff Jul 18, 2025
c34ad9b
POC: functional tests (in progress)
marcalff Jul 18, 2025
322f8a6
shelltest
marcalff Jul 18, 2025
69aa84b
shelltest
marcalff Jul 18, 2025
b2185ee
More functional tests
marcalff Jul 19, 2025
c4b96da
Merge branch 'main' into poc_config_yaml
marcalff Jul 19, 2025
eb018dd
Code review comments (sdk_builder)
marcalff Jul 19, 2025
14c90db
kitchen-sink functional test
marcalff Jul 19, 2025
5bad609
build cleanup
marcalff Jul 20, 2025
31610b8
Add GRPC to yaml build
marcalff Jul 20, 2025
a024ac2
Fixed format to ignore tests data and scripts
marcalff Jul 20, 2025
ac1ab49
Fixed format
marcalff Jul 20, 2025
0c44815
format for tests
marcalff Jul 20, 2025
44acc5f
Rework on ConfiguredSdk
marcalff Jul 20, 2025
98010cf
Merge branch 'main' into poc_config_yaml
marcalff Jul 21, 2025
09ab6dd
Merge after ParentBasedSampler fix
marcalff Jul 21, 2025
d2479b2
Merge branch 'main' into poc_config_yaml
marcalff Jul 22, 2025
d17b087
Merge branch 'main' into poc_config_yaml
marcalff Jul 23, 2025
6fc4d37
Add propagator unit tests
marcalff Jul 23, 2025
d9580d0
Rework on MetricProducer
marcalff Jul 23, 2025
d95b53e
Rework for propagators, added tests.
marcalff Jul 23, 2025
7d4163f
Functional test cleanup
marcalff Jul 23, 2025
604502b
Cleanup
marcalff Jul 24, 2025
93b9b21
Merge branch 'main' into poc_config_yaml
marcalff Jul 24, 2025
3f1e66b
Rework exporters CMake
marcalff Jul 24, 2025
c9e4d27
exporter cleanup
marcalff Jul 26, 2025
73473ef
exporters, use model parameters.
marcalff Jul 26, 2025
c9f9628
cleanup
marcalff Jul 26, 2025
1554ec9
build cleanup
marcalff Jul 27, 2025
22b5ecb
build cleanup
marcalff Jul 27, 2025
8cd1b6b
Code review comments, rule of 0, misc cleanup
marcalff Jul 27, 2025
6c40847
Merge branch 'main' into poc_config_yaml
marcalff Jul 28, 2025
3b31867
adjust after merge
marcalff Jul 28, 2025
74d4395
configuration example
marcalff Jul 29, 2025
ee51010
Merge branch 'main' into poc_config_yaml
marcalff Jul 29, 2025
f26f488
cleanup
marcalff Jul 29, 2025
8619945
Merge branch 'main' into poc_config_yaml
marcalff Aug 4, 2025
21ddb9b
Code review comments.
marcalff Aug 4, 2025
61ab0e8
Merge branch 'main' into poc_config_yaml
marcalff Aug 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,48 @@ jobs:
run: |
(cd ./functional/otlp; ./run_test.sh)

cmake_clang_yaml_config:
name: CMake clang 18 (maintainer mode, yaml config)
runs-on: ubuntu-24.04
env:
CC: /usr/bin/clang-18
CXX: /usr/bin/clang++-18
CXX_STANDARD: '14'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'
- name: setup
run: |
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: install ryml
run: |
sudo -E ./ci/install_ryml.sh
- name: run cmake clang (maintainer mode, sync)
run: |
./ci/do_ci.sh cmake.maintainer.yaml.test
- name: install shelltest
run: sudo apt update && sudo apt-get install -y shelltestrunner
- 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 otlp func test
run: |
(cd ./functional/otlp; ./run_test.sh)
- name: run configuration func test
run: |
(cd ./functional/configuration; ./run_test.sh)

cmake_clang_maintainer_async_test:
name: CMake clang 18 (maintainer mode, async)
runs-on: ubuntu-24.04
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/clang-tidy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
matrix:
include:
- cmake_options: all-options-abiv1-preview
warning_limit: 61
warning_limit: 66
- cmake_options: all-options-abiv2-preview
warning_limit: 61
warning_limit: 66
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
Expand Down Expand Up @@ -48,6 +48,7 @@ jobs:
libgmock-dev \
libgtest-dev \
libbenchmark-dev
sudo ./ci/install_ryml.sh

if ! command -v clang-tidy &> /dev/null; then
echo "clang-tidy could not be found"
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,15 @@ jobs:
llvm-dev \
libclang-dev \
cmake

- name: Install rapidyaml
run: |
sudo ./ci/install_ryml.sh

- name: Install include-what-you-use
run: |
sudo ./ci/install_iwyu.sh

- name: Prepare CMake
env:
CC: clang
Expand Down
11 changes: 11 additions & 0 deletions .iwyu.imp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
{ "include": ["<bits/types/struct_tm.h>", "private", "<time.h>", "public"] },
{ "include": ["<bits/types/struct_FILE.h>", "private", "<stdio.h>", "public"] },

# Work around for ryml
{ "include": ["<c4/std/string.hpp>", "private", "<ryml_std.hpp>", "public"] },

{ "include": ["<c4/yml/node.hpp>", "private", "<ryml.hpp>", "public"] },
{ "include": ["<c4/yml/parse.hpp>", "private", "<ryml.hpp>", "public"] },
{ "include": ["<c4/yml/parse_engine.hpp>", "private", "<ryml.hpp>", "public"] },
{ "include": ["<c4/yml/tree.hpp>", "private", "<ryml.hpp>", "public"] },
{ "include": ["<c4/yml/event_handler_tree.hpp>", "private", "<ryml.hpp>", "public"] },
{ "include": ["<c4/substr.hpp>", "private", "<ryml.hpp>", "public"] },
{ "include": ["<c4/substr_fwd.hpp>", "private", "<ryml.hpp>", "public"] },

# Local opentelemetry-cpp style

# We prefer to include <gtest/gtest.h> for simplicity
Expand Down
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ endif()
option(WITH_ABI_VERSION_1 "ABI version 1" ON)
option(WITH_ABI_VERSION_2 "EXPERIMENTAL: ABI version 2 preview" OFF)

option(WITH_CONFIGURATION "EXPERIMENTAL: YAML configuration file" OFF)

file(READ "${CMAKE_CURRENT_LIST_DIR}/api/include/opentelemetry/version.h"
OPENTELEMETRY_CPP_HEADER_VERSION_H)

Expand Down Expand Up @@ -382,6 +384,18 @@ if((NOT WITH_API_ONLY) AND USE_NLOHMANN_JSON)
include("${opentelemetry-cpp_SOURCE_DIR}/cmake/nlohmann-json.cmake")
endif()

#
# Do we need RapidYaml ?
#

if((NOT WITH_API_ONLY) AND WITH_CONFIGURATION)
find_package(ryml 0.7.2 REQUIRED)
message(
STATUS
"Found ryml: include ${RYML_INCLUDE_DIR}, lib ${RYML_LIB_DIR}, version ${ryml_VERSION}"
)
endif()

#
# Do we need OpenTracing ?
#
Expand Down
2 changes: 2 additions & 0 deletions api/include/opentelemetry/common/string_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#pragma once

#include <ctype.h>

#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/version.h"

Expand Down
25 changes: 25 additions & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,31 @@ elif [[ "$1" == "cmake.maintainer.abiv2.test" ]]; then
eval "$MAKE_COMMAND"
make test
exit 0
elif [[ "$1" == "cmake.maintainer.yaml.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=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 \
-DWITH_CONFIGURATION=ON \
"${SRC_DIR}"
eval "$MAKE_COMMAND"
make test
exit 0
elif [[ "$1" == "cmake.with_async_export.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
Expand Down
32 changes: 32 additions & 0 deletions ci/install_ryml.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

set -ex
export DEBIAN_FRONTEND=noninteractive
[ -z "${RYML_VERSION}" ] && export RYML_VERSION="v0.9.0"

BUILD_DIR=/tmp/
INSTALL_DIR=/usr/local/
pushd $BUILD_DIR
git clone --recursive -b ${RYML_VERSION} https://github.com/biojppm/rapidyaml.git

cd rapidyaml
RYML_BUILD_OPTIONS=(
"-DBUILD_TESTING=OFF"
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
"-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR"
)

if [ ! -z "${CXX_STANDARD}" ]; then
RYML_BUILD_OPTIONS=(${RYML_BUILD_OPTIONS[@]} "-DCMAKE_CXX_STANDARD=${CXX_STANDARD}")
fi

mkdir build && pushd build
cmake "${RYML_BUILD_OPTIONS[@]}" ..
make -j $(nproc)
make install
popd
popd
export PATH=${INSTALL_DIR}/bin:$PATH # ensure to use the installed ryml
4 changes: 4 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ add_subdirectory(multi_processor)
if(WITH_EXAMPLES_HTTP)
add_subdirectory(http)
endif()

if(WITH_CONFIGURATION)
add_subdirectory(configuration)
endif()
86 changes: 86 additions & 0 deletions examples/configuration/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

if(DEFINED OPENTELEMETRY_BUILD_DLL)
add_definitions(-DOPENTELEMETRY_BUILD_IMPORT_DLL)
endif()

include_directories(${CMAKE_SOURCE_DIR}/sdk/include)

add_executable(
example_yaml
main.cc
custom_sampler.cc
custom_sampler_builder.cc
custom_span_exporter.cc
custom_span_exporter_builder.cc
custom_span_processor.cc
custom_span_processor_builder.cc
custom_push_metric_exporter.cc
custom_push_metric_exporter_builder.cc
custom_pull_metric_exporter.cc
custom_pull_metric_exporter_builder.cc
custom_log_record_exporter.cc
custom_log_record_exporter_builder.cc
custom_log_record_processor.cc
custom_log_record_processor_builder.cc)

target_link_libraries(
example_yaml
${CMAKE_THREAD_LIBS_INIT}
common_metrics_foo_library
common_logs_foo_library
opentelemetry_exporter_ostream_span_builder
opentelemetry_exporter_ostream_metrics_builder
opentelemetry_exporter_ostream_logs_builder)

if(WITH_OTLP_HTTP)
include_directories(${CMAKE_SOURCE_DIR}/exporters/otlp/include)
add_definitions(-DOTEL_HAVE_OTLP_HTTP)
target_link_libraries(example_yaml opentelemetry_exporter_otlp_http_builder)
target_link_libraries(example_yaml
opentelemetry_exporter_otlp_http_log_builder)
target_link_libraries(example_yaml
opentelemetry_exporter_otlp_http_metric_builder)
endif()

if(WITH_OTLP_GRPC)
include_directories(${CMAKE_SOURCE_DIR}/exporters/otlp/include)
add_definitions(-DOTEL_HAVE_OTLP_GRPC)
target_link_libraries(example_yaml opentelemetry_exporter_otlp_grpc_builder)
target_link_libraries(example_yaml
opentelemetry_exporter_otlp_grpc_log_builder)
target_link_libraries(example_yaml
opentelemetry_exporter_otlp_grpc_metrics_builder)
endif()

if(WITH_OTLP_FILE)
include_directories(${CMAKE_SOURCE_DIR}/exporters/otlp/include)
add_definitions(-DOTEL_HAVE_OTLP_FILE)
target_link_libraries(example_yaml opentelemetry_exporter_otlp_file_builder)
target_link_libraries(example_yaml
opentelemetry_exporter_otlp_file_log_builder)
target_link_libraries(example_yaml
opentelemetry_exporter_otlp_file_metric_builder)
endif()

if(WITH_ZIPKIN)
include_directories(${CMAKE_SOURCE_DIR}/exporters/zipkin/include)
add_definitions(-DOTEL_HAVE_ZIPKIN)
target_link_libraries(example_yaml
opentelemetry_exporter_zipkin_trace_builder)
endif()

if(WITH_PROMETHEUS)
include_directories(${CMAKE_SOURCE_DIR}/exporters/prometheus/include)
add_definitions(-DOTEL_HAVE_PROMETHEUS)
target_link_libraries(example_yaml opentelemetry_exporter_prometheus_builder)
endif()

if(DEFINED OPENTELEMETRY_BUILD_DLL)
target_link_libraries(example_yaml opentelemetry_cpp)
else()
target_link_libraries(
example_yaml opentelemetry_configuration opentelemetry_common
opentelemetry_trace opentelemetry_logs)
endif()
45 changes: 45 additions & 0 deletions examples/configuration/anchors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

# anchors.yaml demonstrates anchor substitution to reuse OTLP exporter configuration across signals.

file_format: "0.1"
exporters:
otlp: &otlp-exporter
protocol: http/protobuf
endpoint: http://localhost:4318
certificate: /app/cert.pem
client_key: /app/cert.pem
client_certificate: /app/cert.pem
headers:
api-key: !!str 1234
compression: gzip
timeout: 10000

logger_provider:
processors:
- batch:
exporter:
otlp:
# expand the otlp-exporter anchor
<<: *otlp-exporter

meter_provider:
readers:
- periodic:
interval: 5000
timeout: 30000
exporter:
otlp:
# expand the otlp-exporter anchor and add metric specific configuration
<<: *otlp-exporter
temporality_preference: delta
default_histogram_aggregation: base2_exponential_bucket_histogram

tracer_provider:
processors:
- batch:
exporter:
otlp:
# expand the otlp-exporter anchor
<<: *otlp-exporter
Loading
Loading