Skip to content

[CONFIGURATION] Split programmatic and YAML cmake targets#4138

Open
pranitaurlam wants to merge 2 commits into
open-telemetry:mainfrom
pranitaurlam:feat/split-configuration-cmake-targets
Open

[CONFIGURATION] Split programmatic and YAML cmake targets#4138
pranitaurlam wants to merge 2 commits into
open-telemetry:mainfrom
pranitaurlam:feat/split-configuration-cmake-targets

Conversation

@pranitaurlam
Copy link
Copy Markdown

@pranitaurlam pranitaurlam commented Jun 7, 2026

Fixes #4134

Summary

  • Splits opentelemetry_configuration into two CMake targets:
    • opentelemetry_configuration: programmatic configuration only (sdk_builder.cc, configured_sdk.cc, registry.cc, configuration_parser.cc, document_node.cc, composable sampler builders). No ryml dependency. Built unconditionally as part of the SDK.
    • opentelemetry_configuration_yaml: YAML configuration components (yaml_configuration_parser.cc, ryml_document.cc, ryml_document_node.cc) with the ryml::ryml dependency. Gated by WITH_CONFIGURATION.
  • Repurposes WITH_CONFIGURATION to gate only the YAML/ryml target.
  • Adds a default constructor to Configuration so it can be instantiated programmatically without a Document.
  • Updates cmake component names: configuration_yaml replaces configuration for the YAML component; the configuration component is now the programmatic-only piece included in the SDK.

Test plan

  • Build without WITH_CONFIGURATION and verify opentelemetry_configuration links successfully without ryml
  • Build with WITH_CONFIGURATION=ON and verify both targets build and tests pass
  • Verify the example programmatic configuration from the issue compiles against opentelemetry_configuration alone

cc @marcalff @lalitb @dbarker @ThomsonTan

@pranitaurlam pranitaurlam requested a review from a team as a code owner June 7, 2026 18:19
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Jun 7, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: pranitaurlam / name: pranitaurlam (eab1f2b)

Split opentelemetry_configuration into two targets:
- opentelemetry_configuration: programmatic config, no ryml dependency,
  built unconditionally as part of the SDK
- opentelemetry_configuration_yaml: YAML config with ryml dependency,
  gated by WITH_CONFIGURATION

Add default constructor to Configuration for programmatic use.
@pranitaurlam
Copy link
Copy Markdown
Author

Hi @marcalff @lalitb @dbarker @ThomsonTan

I've opened PR #4138 to resolve issue #4134 — splitting the opentelemetry_configuration CMake target into two separate targets so users can use programmatic configuration without pulling in the ryml dependency.

The EasyCLA check has passed. Could one of you please approve the workflow runs so CI can execute? Any feedback on the implementation is also very welcome.

Thank you!

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.02%. Comparing base (4352a63) to head (eab1f2b).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4138      +/-   ##
==========================================
+ Coverage   82.01%   82.02%   +0.02%     
==========================================
  Files         385      385              
  Lines       16093    16093              
==========================================
+ Hits        13197    13199       +2     
+ Misses       2896     2894       -2     
Files with missing lines Coverage Δ
...de/opentelemetry/sdk/configuration/configuration.h 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Restore configuration as standalone install component (not part of sdk)
- Add configuration_yaml to EXPECTED_COMPONENTS in do_ci.sh
- Fix cmake-format in CMakeLists.txt, sdk/src/configuration, sdk/test/configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Programmatic Configuration without YAML dependencies

1 participant