Skip to content
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

Update resource merge behaviour #537

Merged
merged 1 commit into from May 3, 2021

Conversation

frigus02
Copy link
Member

@frigus02 frigus02 commented May 3, 2021

The resource merge behaviour changed 3 months ago to be consistent with Span.SetAttribute (commit). It now specifies:

The resulting resource MUST have all attributes that are on any of the two input resources. If a key exists on both the old and updating resource, the value of the updating resource MUST be picked (even if the updated value is empty).

This updates sdk::Resource::merge to behave as described in the spec.


Note: I didn't have the time to check where sdk::Resource::merge is used and if this change affects anything, yet.

The resource merge behaviour changed 3 months ago to be consistent with
Span.SetAttribute. It now specifies:

> The resulting resource MUST have all attributes that are on any of the
> two input resources. If a key exists on both the old and updating
> resource, the value of the updating resource MUST be picked (even if
> the updated value is empty).

This updates sdk::Resource::merge to behave as described in the spec.
@frigus02 frigus02 requested a review from a team as a code owner May 3, 2021 07:06
@codecov
Copy link

codecov bot commented May 3, 2021

Codecov Report

Merging #537 (8bbb911) into main (a9f1453) will decrease coverage by 0.0%.
The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #537     +/-   ##
=======================================
- Coverage   52.2%   52.2%   -0.1%     
=======================================
  Files         96      96             
  Lines       8513    8505      -8     
=======================================
- Hits        4451    4443      -8     
  Misses      4062    4062             
Impacted Files Coverage Δ
opentelemetry/src/sdk/resource.rs 74.0% <100.0%> (-1.8%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a9f1453...8bbb911. Read the comment docs.

Copy link
Member

@jtescher jtescher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks @frigus02

@jtescher jtescher merged commit 3a8123c into open-telemetry:main May 3, 2021
@frigus02 frigus02 deleted the resource-merge branch May 3, 2021 18:12
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.

None yet

2 participants