-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Resource dedup logic #1295
Fix Resource dedup logic #1295
Conversation
Previously Resource would have last k,v wins when supplied a list of k,v even if it was empty. This change brings the logic in line with the documentation on Resource::new and also applies the same to `from_detectors`.
Codecov ReportAll modified lines are covered by tests ✅
📢 Thoughts on this report? Let us know!. |
Co-authored-by: Lalit Kumar Bhasin <[email protected]>
@BrynCooke thank you for your contribution. Unfortunately looking at the specs we should not even have an insert https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md |
@hdost The |
Indeed, however I do have one other issue as this works counter to the spec for merge.
|
Makes sense, I've instead raise an issue for discussion #1298 that hopefully captures the issues around the current behaviour. I'll leave this PR for you to close though. |
Good point. |
Also from the spec: So definitely agree that this PR doesn't fit the bill. |
Changes
Previously Resource would have last k,v wins when supplied a list of k,v even if it was empty.
This change brings the logic in line with the documentation on Resource::new and also applies the same to
from_detectors
.Design
Suspect that the implementation was just an oversight as the existing doc comment seems to describe the desired behaviour.
Users will be able to specify a list of detectors in priority order and expect them to have first non empty value wins.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes