[CONFIGURATION] Split programmatic and YAML cmake targets
Fixes #4134
Summary
- Splits
opentelemetry_configurationinto 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). Norymldependency. 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 theryml::rymldependency. Gated byWITH_CONFIGURATION.
- Repurposes
WITH_CONFIGURATIONto gate only the YAML/ryml target. - Adds a default constructor to
Configurationso it can be instantiated programmatically without aDocument. - Updates cmake component names:
configuration_yamlreplacesconfigurationfor the YAML component; theconfigurationcomponent is now the programmatic-only piece included in the SDK.
Test plan
- [x] Build without
WITH_CONFIGURATIONand verifyopentelemetry_configurationlinks successfully without ryml - [x] Build with
WITH_CONFIGURATION=ONand verify both targets build and tests pass - [x] Verify the example programmatic configuration from the issue compiles against
opentelemetry_configurationalone
cc @lalitb @marcalff @lalitb @dbarker @ThomsonTan
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: pranitaurlam / name: pranitaurlam (2a5f743016f4bc571e0d337ad8a62c25708b9344, 9c36d754b3c387e48c3d6893846b16e238432d12, a7a35d474fc2bb059223a5fbd349fa7fa6108862, e3d85122fab7c5dcbee4eecd291904c46329f096, eab1f2b1187181a67da0883cd120b74f754f76b3, efe4b1285354b30bf7c6e3e8ed9cf0865bd21114)
Hi @lalitb @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 Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 82.82%. Comparing base (17c4723) to head (499e3ac).
:warning: Report is 51 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #4138 +/- ##
=======================================
Coverage 82.82% 82.82%
=======================================
Files 406 406
Lines 16913 16913
=======================================
Hits 14007 14007
Misses 2906 2906
| Files with missing lines | Coverage Δ | |
|---|---|---|
| ...de/opentelemetry/sdk/configuration/configuration.h | 100.00% <ø> (ø) |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@pranitaurlam Thanks for the contribution. Marc and I discussed the PR in the SIG meeting today and request the following changes to minimize impact on current users of the configuration CMake component and opentelemetry-cpp::configuration CMake target.
Instead of placing the yaml components in the configuration_yaml target we suggest:
- Create a new CMake target
opentelemetry-cpp::configuration_coreto include the programmatic configuration objects. This new target should be built unconditionally with the SDK. - Update the
configurationCMake component andopentelemetry-cpp::configurationCMake target to link toconfiguration_coreand include only the yaml objects and ryml dependency. This component and target should still be guarded by theWITH_CONFIGURATIONCMake option.
This way current users of the yaml config will continue to link to the opentelemetry-cpp::configuration target and new users of the programmatic config can link to opentelemetry-cpp::configuration_core.
So, in short:
- rename opentelemetry-cpp::configuration to opentelemetry-cpp::configuration_core
- rename opentelemetry-cpp::configuration_yaml to opentelemetry-cpp::configuration
This way, applications using opentelemetry-cpp::configuration in their makefiles will be unchanged.
Hi @pranitaurlam, just checking in. Are you still working on this PR and have any questions based on comments above?