Skip to content

[CONFIGURATION] Add builders for the container and process resource detectors - #4417

Merged
dbarker merged 5 commits into
open-telemetry:mainfrom
mateenali66:feat/4412-detector-builders
Aug 12, 2026
Merged

[CONFIGURATION] Add builders for the container and process resource detectors#4417
dbarker merged 5 commits into
open-telemetry:mainfrom
mateenali66:feat/4412-detector-builders

Conversation

@mateenali66

Copy link
Copy Markdown
Contributor

Fixes #4412

Changes

Adds configuration builders for the two existing resource detectors, ContainerDetectorBuilder and ProcessDetectorBuilder, in resource_detectors/, following the ConsoleSpanBuilder pattern. Both are registered in examples/configuration/main.cc behind a new OTEL_HAVE_RESOURCE_DETECTORS define, since that example also builds without WITH_RESOURCE_DETECTORS_PREVIEW.

The builders ship as a new resource_detectors_builder component mirroring the exporter builder components, with the matching install component test and an entry in the cmake.install.test expected components list.

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

…etectors

Signed-off-by: Mateen Anjum <mateenali66@gmail.com>
@mateenali66
mateenali66 requested a review from a team as a code owner August 12, 2026 00:07
Linking configuration_core pulls in sdk_builder.cc, which requires
exception support, so the new builder tests move to a separate test
target that the noexcept build skips, like sdk/test/configuration.

Signed-off-by: Mateen Anjum <mateenali66@gmail.com>
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.58%. Comparing base (4aee171) to head (7871b87).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4417      +/-   ##
==========================================
- Coverage   82.69%   82.58%   -0.11%     
==========================================
  Files         505      509       +4     
  Lines       19933    19972      +39     
==========================================
+ Hits        16482    16492      +10     
- Misses       3451     3480      +29     
Files with missing lines Coverage Δ
...source_detectors/src/container_detector_builder.cc 100.00% <100.00%> (ø)
resource_detectors/src/process_detector_builder.cc 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

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

Signed-off-by: Mateen Anjum <mateenali66@gmail.com>

@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 feature! Please see feedback and a change request to the CMake configuration below.

Comment thread resource_detectors/CMakeLists.txt Outdated
Comment thread install/test/src/test_resource_detectors_builder.cc Outdated
Per review: the builders target joins the existing resource_detectors
component instead of shipping as its own, renamed to
opentelemetry_resource_detectors_builders, and its install test cases
merge into the component's existing test file.

Signed-off-by: Mateen Anjum <mateenali66@gmail.com>

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

Looks good. Thank you.

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

@dbarker
dbarker merged commit 2499c49 into open-telemetry:main Aug 12, 2026
71 of 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] Create builders for the container and process resource detectors

3 participants