Skip to content

[CONFIGURATION] Add composable sampler extensions - #4415

Merged
dbarker merged 3 commits into
open-telemetry:mainfrom
shixi-li:codex/composable-sampler-extensions
Aug 12, 2026
Merged

[CONFIGURATION] Add composable sampler extensions#4415
dbarker merged 3 commits into
open-telemetry:mainfrom
shixi-li:codex/composable-sampler-extensions

Conversation

@shixi-li

Copy link
Copy Markdown
Contributor

Fixes #4409

Changes

  • Add configuration and builder interfaces for custom composable sampler extensions.
  • Preserve the extension name, raw configuration node, and nesting depth during YAML parsing.
  • Resolve registered composable sampler extensions through the SDK registry, with tests for parsing, registration, construction, and missing builders.

Testing

  • cmake --build build --target registry_test yaml_trace_test sdk_builder_test -j4
  • registry_test, yaml_trace_test, and sdk_builder_test (125 tests passed)
  • clang-format --dry-run --Werror on the changed C++ files

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@shixi-li
shixi-li requested a review from a team as a code owner August 11, 2026 18:38
@linux-foundation-easycla

linux-foundation-easycla Bot commented Aug 11, 2026

Copy link
Copy Markdown

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

@shixi-li
shixi-li marked this pull request as draft August 11, 2026 18:39
@marcalff marcalff added the pr:waiting-on-cla Waiting on CLA label Aug 11, 2026
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.69%. Comparing base (19e0244) to head (04a9ee8).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4415      +/-   ##
==========================================
+ Coverage   82.65%   82.69%   +0.05%     
==========================================
  Files         503      505       +2     
  Lines       19904    19933      +29     
==========================================
+ Hits        16449    16482      +33     
+ Misses       3455     3451       -4     
Files with missing lines Coverage Δ
...uration/composable_sampler_configuration_visitor.h 100.00% <ø> (ø)
...nfiguration/extension_composable_sampler_builder.h 100.00% <100.00%> (ø)
...ation/extension_composable_sampler_configuration.h 100.00% <100.00%> (ø)
...include/opentelemetry/sdk/configuration/registry.h 100.00% <ø> (ø)
sdk/src/configuration/configuration_parser.cc 79.90% <100.00%> (+0.21%) ⬆️
sdk/src/configuration/registry.cc 100.00% <100.00%> (ø)
sdk/src/configuration/sdk_builder.cc 58.99% <100.00%> (+0.40%) ⬆️

... 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.

Copy link
Copy Markdown
Contributor Author

/easycla

@shixi-li
shixi-li marked this pull request as ready for review August 12, 2026 06:37
@marcalff marcalff removed the pr:waiting-on-cla Waiting on CLA label Aug 12, 2026
@marcalff marcalff self-assigned this Aug 12, 2026

@marcalff marcalff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Excellent work, fits perfectly into the existing design pattern.

@dbarker dbarker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Adding a custom composable sampler example in examples/configuration would be a great followup PR to show others how to use this new extension point.

@dbarker
dbarker merged commit 4aee171 into open-telemetry:main Aug 12, 2026
73 checks passed
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.

[CONFIGURATION] Implement ComposableSampler Extensions

3 participants