diff --git a/CHANGELOG.md b/CHANGELOG.md index c2c6e27cc1b..523099cf3c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ All notable changes to this project will be documented in this file. * fix: sanitize attributes inputs [#2881](https://github.com/open-telemetry/opentelemetry-js/pull/2881) @legendecas * fix: support earlier API versions [#2892](https://github.com/open-telemetry/opentelemetry-js/pull/2892) @dyladan * fix: support extract one digit '0' in jaeger traceFlag [#2905](https://github.com/open-telemetry/opentelemetry-js/issues/2905) @shmilyoo +* fix(resources): extend ResourceAttributes interface to comply with spec [#2924](https://github.com/open-telemetry/opentelemetry-js/pull/2924) @blumamir ### :books: (Refine Doc) diff --git a/packages/opentelemetry-resources/src/types.ts b/packages/opentelemetry-resources/src/types.ts index 94d5e4b8928..717f71381d1 100644 --- a/packages/opentelemetry-resources/src/types.ts +++ b/packages/opentelemetry-resources/src/types.ts @@ -16,11 +16,14 @@ import { Resource } from './Resource'; import { ResourceDetectionConfig } from './config'; +import { SpanAttributes } from '@opentelemetry/api'; -/** Interface for Resource attributes */ -export interface ResourceAttributes { - [key: string]: number | string | boolean; -} +/** + * 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; /** * Interface for a Resource Detector. In order to detect resources in parallel