Skip to content

Commit 0aba75c

Browse files
chore(otel-resources): replace deprecated spanAttributes (#4428)
* 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]>
1 parent 9727686 commit 0aba75c

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

CHANGELOG_NEXT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

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

89
### :rocket: (Enhancement)
910

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/opentelemetry-resources/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"access": "public"
6262
},
6363
"devDependencies": {
64-
"@opentelemetry/api": ">=1.0.0 <1.8.0",
64+
"@opentelemetry/api": ">=1.1.0 <1.8.0",
6565
"@opentelemetry/resources_1.9.0": "npm:@opentelemetry/[email protected]",
6666
"@types/mocha": "10.0.6",
6767
"@types/node": "18.6.5",

packages/opentelemetry-resources/src/Resource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class Resource implements IResource {
119119
merge(other: IResource | null): IResource {
120120
if (!other) return this;
121121

122-
// SpanAttributes from other resource overwrite attributes from this resource.
122+
// Attributes from other resource overwrite attributes from this resource.
123123
const mergedSyncAttributes = {
124124
...this._syncAttributes,
125125
//Support for old resource implementation where _syncAttributes is not defined

packages/opentelemetry-resources/src/types.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@
1515
*/
1616

1717
import { ResourceDetectionConfig } from './config';
18-
import { SpanAttributes } from '@opentelemetry/api';
18+
import { Attributes } from '@opentelemetry/api';
1919
import { IResource } from './IResource';
2020

2121
/**
2222
* Interface for Resource attributes.
23-
* General `Attributes` interface is added in api v1.1.0.
24-
* To backward support older api (1.0.x), the deprecated `SpanAttributes` is used here.
2523
*/
26-
export type ResourceAttributes = SpanAttributes;
24+
// TODO: replace ResourceAttributes with Attributes
25+
export type ResourceAttributes = Attributes;
2726

2827
/**
2928
* @deprecated please use {@link DetectorSync}

0 commit comments

Comments
 (0)