Conversation
Pull request dashboard statusWaiting on the author · refreshed 2026-09-14 16:34 UTC Move out of draft to request review. Status above doesn't look right?
|
…from the user provided values from the resource detectors
cc9853d to
c408da2
Compare
| detected_resource = future.result(timeout=timeout) | ||
|
|
||
| if ( | ||
| isinstance(detector, ServiceInstanceIdResourceDetector) |
There was a problem hiding this comment.
Can we note just move this detector to the front of the detectors list?
There was a problem hiding this comment.
Agreed that there should be a more generalized solution pattern. Is it established though that detectors that go later should always override ones that came before? Because it seems like it would actually be more intuitive that detectors that come earlier should take precedent. I'm just not sure if there's spec on this exact issue.
There was a problem hiding this comment.
That is a good suggestion as it would handle initial resource creation by allowing later platform or user-configured detectors to override the generated UUID.
However, these changes would not cover post-fork refreshes, where only process-dependent detectors are rerun and the newly generated UUID could overwrite the existing platform/user-provided service.instance.id.
We could handle that separately by updating the fork-refresh logic to replace the instance ID only when the current value is the SDK-generated ID; otherwise, preserve the existing value.
There was a problem hiding this comment.
However, these changes would not cover post-fork refreshes, where only process-dependent detectors are rerun and the newly generated UUID could overwrite the existing platform/user-provided service.instance.id.
If a resource detector populates service.instance.id, then it should regenerate it post fork (i.e. it needs to be a process-dependent resource detector) per the spec: service.namespace,service.name,service.instance.id should be globally unique.
We could handle that separately by updating the fork-refresh logic to replace the instance ID only when the current value is the SDK-generated ID; otherwise, preserve the existing value.
This could result in multiple processes having the same service.namespace,service.name,service.instance.id tuple.
Shriprasad-P
left a comment
There was a problem hiding this comment.
Thanks for the PR. Approach looks sensible — please confirm edge cases and failure paths are covered by tests.
Description
Prevent
ServiceInstanceIdResourceDetectorfrom overwriting an existingservice.instance.idset by another resource detector(ex. Azure) or user configuration. Add regression coverage for detector-, initial-resource-, and environment-provided IDs, while retaining UUID generation when no ID is present.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Contrib Repo Change?
Checklist: