Skip to content

[CONFIGURATION] Programmatic configuration use case tests and fixes - #4243

Merged
marcalff merged 11 commits into
open-telemetry:mainfrom
dbarker:test_programmatic_configuration
Jul 18, 2026
Merged

marcalff merged 11 commits into
open-telemetry:mainfrom
dbarker:test_programmatic_configuration

Conversation

@dbarker

@dbarker dbarker commented Jul 13, 2026

Copy link
Copy Markdown
Member

Contributes to #4134

Adds unit and integration tests for the programmatic configuration use case and fixes issues found.

Changes

  • Fixes missing initialization of SdkBuilder and ConfiguredSdk members.
  • Fixes issues with SdkBuilder for the programmatic configuration use case
    • Set the default sampler to parent based always on when the sampler config is null
    • Set the default parent based root sampler to always_on when configured root sampler is null
    • Set the default metric stream aggregation when the aggregation config is null
    • Set export_timeout for batch processors. (export timeout is unused in the SDK but should be configured to avoid being set by the environment variable)
  • SdkBuilder test for CreateParentBasedSampler has been added
  • ConfiguredSdk tests for the core interface (Global Logger/Install/Uninstall) have been added
  • Programmatic Configuration integration tests have been added to verify the configured SDK has the expected components and exports expected signal data

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

@dbarker
dbarker marked this pull request as ready for review July 13, 2026 19:52
@dbarker
dbarker requested a review from a team as a code owner July 13, 2026 19:52
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.16%. Comparing base (3e4296e) to head (b5c19ec).

Files with missing lines Patch % Lines
sdk/src/configuration/sdk_builder.cc 80.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4243      +/-   ##
==========================================
+ Coverage   78.15%   81.16%   +3.01%     
==========================================
  Files         440      444       +4     
  Lines       18736    18800      +64     
==========================================
+ Hits        14642    15257     +615     
+ Misses       4094     3543     -551     
Files with missing lines Coverage Δ
...e/opentelemetry/sdk/configuration/configured_sdk.h 100.00% <ø> (+100.00%) ⬆️
sdk/src/configuration/sdk_builder.cc 45.05% <80.00%> (+40.05%) ⬆️

... and 39 files with indirect coverage changes

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

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

Thanks for all the tests.

Comment thread sdk/test/configuration/configured_sdk_test.cc
@marcalff
marcalff merged commit b1d403d into open-telemetry:main Jul 18, 2026
72 checks passed
@dbarker
dbarker deleted the test_programmatic_configuration branch July 18, 2026 11:12
ayush-that pushed a commit to ayush-that/opentelemetry-cpp that referenced this pull request Jul 21, 2026
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.

2 participants