Skip to content

Commit

Permalink
chore(otel-resources): replace deprecated spanAttributes (#4428)
Browse files Browse the repository at this point in the history
* chore(otel-resources): replace deprecated spanAttributes

* update minimum api version to 1.1

* update changelog

* per legendecas, add todo for ResourceAttributes

---------

Co-authored-by: Marc Pichler <[email protected]>
  • Loading branch information
JamieDanielson and pichlermarc authored Jan 22, 2024
1 parent 9727686 commit 0aba75c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_NEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* chore(shim-opentracing): replace deprecated SpanAttributes [#4430](https://github.com/open-telemetry/opentelemetry-js/pull/4430) @JamieDanielson
* chore(otel-core): replace deprecated SpanAttributes [#4408](https://github.com/open-telemetry/opentelemetry-js/pull/4408) @JamieDanielson
* chore(otel-resources): replace deprecated SpanAttributes [#4428](https://github.com/open-telemetry/opentelemetry-js/pull/4428) @JamieDanielson

### :rocket: (Enhancement)

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/opentelemetry-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"access": "public"
},
"devDependencies": {
"@opentelemetry/api": ">=1.0.0 <1.8.0",
"@opentelemetry/api": ">=1.1.0 <1.8.0",
"@opentelemetry/resources_1.9.0": "npm:@opentelemetry/[email protected]",
"@types/mocha": "10.0.6",
"@types/node": "18.6.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry-resources/src/Resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class Resource implements IResource {
merge(other: IResource | null): IResource {
if (!other) return this;

// SpanAttributes from other resource overwrite attributes from this resource.
// Attributes from other resource overwrite attributes from this resource.
const mergedSyncAttributes = {
...this._syncAttributes,
//Support for old resource implementation where _syncAttributes is not defined
Expand Down
7 changes: 3 additions & 4 deletions packages/opentelemetry-resources/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
*/

import { ResourceDetectionConfig } from './config';
import { SpanAttributes } from '@opentelemetry/api';
import { Attributes } from '@opentelemetry/api';
import { IResource } from './IResource';

/**
* Interface for Resource attributes.
* General `Attributes` interface is added in api v1.1.0.
* To backward support older api (1.0.x), the deprecated `SpanAttributes` is used here.
*/
export type ResourceAttributes = SpanAttributes;
// TODO: replace ResourceAttributes with Attributes
export type ResourceAttributes = Attributes;

/**
* @deprecated please use {@link DetectorSync}
Expand Down

0 comments on commit 0aba75c

Please sign in to comment.