[CONFIGURATION] Complete resource detection support in SdkBuilder - #4424
Merged
dbarker merged 9 commits intoAug 15, 2026
Merged
Conversation
Signed-off-by: Mateen Anjum <mateenali66@gmail.com>
…elog Signed-off-by: Mateen Anjum <mateenali66@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4424 +/- ##
==========================================
+ Coverage 82.59% 82.62% +0.04%
==========================================
Files 511 511
Lines 20039 20132 +93
==========================================
+ Hits 16550 16633 +83
- Misses 3489 3499 +10
🚀 New features to boost your workflow:
|
… builder A configured detector without a registered builder now fails the SDK build by design, so the aspirational detector entries in the example yaml files move to comments until the example registers builders for them. The my_custom_detector entry returns with open-telemetry#4419. Signed-off-by: Mateen Anjum <mateenali66@gmail.com>
Signed-off-by: Mateen Anjum <mateenali66@gmail.com>
dbarker
approved these changes
Aug 13, 2026
dbarker
left a comment
Member
There was a problem hiding this comment.
Looks good. Thank you! Please see non blocking feedback below.
Per review: kitchen-sink keeps the container and process detectors enabled (the yaml maintainer CI job now builds with WITH_RESOURCE_DETECTORS_PREVIEW so their builders are registered), sdk-default exercises the detection node with the attribute filter and no detectors, plus attributes_list and schema_url, and a test verifies the filter does not apply to attributes and attributes_list. Signed-off-by: Mateen Anjum <mateenali66@gmail.com>
…eview The example yaml tests also run in the OS matrix jobs, which enable WITH_CONFIGURATION without WITH_RESOURCE_DETECTORS_PREVIEW, so the kitchen-sink detectors have no registered builders there. The test now runs only where the preview flag registers them, which includes the yaml maintainer job. Signed-off-by: Mateen Anjum <mateenali66@gmail.com>
…r-resource-detection # Conflicts: # CHANGELOG.md # examples/configuration/extensions.yaml
marcalff
approved these changes
Aug 14, 2026
marcalff
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for the contribution.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4411
Changes
Implements the remaining resource detection support in
SdkBuilder::SetResource, per the required behavior on the issue:ResourceDetectorBuildervisitor (same pattern asSpanExporterBuilder) resolvescontainer,host,processandserviceto their registry builders, and any other name to an extension detector builder looked up by name. A missing builder throwsUnsupportedException, consistent with the otherCreate*methods.detection.attributesusingsdk::common::WildcardMatch. Absentincludedpasses all keys,excludedis applied afterincludedand wins. The filter applies to detected attributes only.Resource::GetDefault(), detected resource (filtered),attributes_list, thenattributeswithschema_urlfrom the model. Merging relies on the documented behavior that the updating resource wins on key conflicts and an empty updating schema url preserves the current one.Behavior note, called out in the changelog:
SetResourceno longer goes throughResource::Create(), so it no longer runsOTELResourceDetector(theOTEL_RESOURCE_ATTRIBUTESenv var) and no longer injects a defaultservice.name. Neither is part of the configuration model, andResource::Create()cannot express the required merge order.The example yaml files listed detectors that nothing registers (they were ignored until now), which the new error behavior turns into SDK build failures. Those entries move to comments until the example registers builders for them; the
my_custom_detectorentry comes back with #4419 (PR #4423), which registers the extension builder.Tests cover the dispatch (typed and extension, with a spy builder), the unregistered-detector failure, the filter semantics (wildcard include, excluded-beats-included, default resource untouched), the four-level merge priority on a conflicting key, and the schema url.
For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes