Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ To request automatic tracing support for a module not on this list, please [file

## Upgrade guidelines

### 0.17.0 to 0.18.0

[PR-1975](https://github.com/open-telemetry/opentelemetry-js/pull/1975)

- Breaking change - 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 - previously it was opposite.

### 0.16.0 to 0.17.0

[PR-1880](https://github.com/open-telemetry/opentelemetry-js/pull/1880) feat(diag-logger): introduce a new global level api.diag for internal diagnostic logging
Expand Down
6 changes: 3 additions & 3 deletions packages/opentelemetry-resources/src/Resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class Resource {

/**
* Returns a new, merged {@link Resource} by merging the current Resource
* with the other Resource. In case of a collision, current Resource takes
* with the other Resource. In case of a collision, other Resource takes
* precedence.
*
* @param other the Resource that will be merged with this.
Expand All @@ -66,8 +66,8 @@ export class Resource {
// SpanAttributes from resource overwrite attributes from other resource.
const mergedAttributes = Object.assign(
{},
other.attributes,
this.attributes
this.attributes,
other.attributes
);
return new Resource(mergedAttributes);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry-resources/test/Resource.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('Resource', () => {

it('should return merged resource when collision in attributes', () => {
const expectedResource = new Resource({
'k8s.io/container/name': 'c1',
'k8s.io/container/name': 'c2',
'k8s.io/namespace/name': 'default',
'k8s.io/pod/name': 'pod-xyz-123',
'k8s.io/location': 'location1',
Expand Down