From 9de31518e76a38050f1a5676124fffd259085263 Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Wed, 25 Sep 2024 16:32:43 +0200 Subject: [PATCH] fix(events,logs): drop outdated API from devDependencies and align types (#5013) --- experimental/CHANGELOG.md | 3 + experimental/packages/sdk-events/package.json | 2 - experimental/packages/sdk-logs/package.json | 1 - .../packages/sdk-logs/src/LogRecord.ts | 4 +- package-lock.json | 74 +------------------ 5 files changed, 8 insertions(+), 76 deletions(-) diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 13454c6eb4..e1ba48d160 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -19,6 +19,9 @@ All notable changes to experimental packages in this project will be documented * fix(sampler-jaeger-remote): fixes an issue where package could emit unhandled promise rejections @Just-Sieb * fix(otlp-grpc-exporter-base): default compression to `'none'` if env vars `OTEL_EXPORTER_OTLP_TRACES_COMPRESSION` and `OTEL_EXPORTER_OTLP_COMPRESSION` are falsy @sjvans +* fix(sdk-events): remove devDependencies to old `@opentelemetry/api-logs@0.52.0`, `@opentelemetry/api-events@0.52.0` packages [#5013](https://github.com/open-telemetry/opentelemetry-js/pull/5013) @pichlermarc +* fix(sdk-logs): remove devDependencies to old `@opentelemetry/api-logs@0.52.0` [#5013](https://github.com/open-telemetry/opentelemetry-js/pull/5013) @pichlermarc +* fix(sdk-logs): align LogRecord#setAttribute type with types from `@opentelemetry/api-logs@0.53.0` [#5013](https://github.com/open-telemetry/opentelemetry-js/pull/5013) @pichlermarc ### :books: (Refine Doc) diff --git a/experimental/packages/sdk-events/package.json b/experimental/packages/sdk-events/package.json index 6ea9047708..03c72bb8ad 100644 --- a/experimental/packages/sdk-events/package.json +++ b/experimental/packages/sdk-events/package.json @@ -68,8 +68,6 @@ "devDependencies": { "@babel/core": "7.25.2", "@opentelemetry/api": "1.9.0", - "@opentelemetry/api-events": "0.52.0", - "@opentelemetry/api-logs": "0.52.0", "@types/mocha": "10.0.8", "@types/node": "18.6.5", "@types/sinon": "10.0.20", diff --git a/experimental/packages/sdk-logs/package.json b/experimental/packages/sdk-logs/package.json index a7938ee0d2..a9d09bec30 100644 --- a/experimental/packages/sdk-logs/package.json +++ b/experimental/packages/sdk-logs/package.json @@ -74,7 +74,6 @@ "@babel/core": "7.25.2", "@babel/preset-env": "7.25.4", "@opentelemetry/api": ">=1.4.0 <1.10.0", - "@opentelemetry/api-logs": "0.52.0", "@opentelemetry/resources_1.9.0": "npm:@opentelemetry/resources@1.9.0", "@types/mocha": "10.0.8", "@types/node": "18.6.5", diff --git a/experimental/packages/sdk-logs/src/LogRecord.ts b/experimental/packages/sdk-logs/src/LogRecord.ts index e7704ec389..f678648e75 100644 --- a/experimental/packages/sdk-logs/src/LogRecord.ts +++ b/experimental/packages/sdk-logs/src/LogRecord.ts @@ -26,7 +26,7 @@ import type { IResource } from '@opentelemetry/resources'; import type { ReadableLogRecord } from './export/ReadableLogRecord'; import type { LogRecordLimits } from './types'; -import { LogAttributes, LogBody } from '@opentelemetry/api-logs'; +import { AnyValue, LogAttributes, LogBody } from '@opentelemetry/api-logs'; import { LoggerProviderSharedState } from './internal/LoggerProviderSharedState'; export class LogRecord implements ReadableLogRecord { @@ -112,7 +112,7 @@ export class LogRecord implements ReadableLogRecord { this.setAttributes(attributes); } - public setAttribute(key: string, value?: LogAttributes | AttributeValue) { + public setAttribute(key: string, value?: AnyValue) { if (this._isLogRecordReadonly()) { return this; } diff --git a/package-lock.json b/package-lock.json index 3978ff726b..cf2acf603b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1413,8 +1413,6 @@ "devDependencies": { "@babel/core": "7.25.2", "@opentelemetry/api": "1.9.0", - "@opentelemetry/api-events": "0.52.0", - "@opentelemetry/api-logs": "0.52.0", "@types/mocha": "10.0.8", "@types/node": "18.6.5", "@types/sinon": "10.0.20", @@ -1445,31 +1443,6 @@ "@opentelemetry/api": ">=1.4.0 <1.10.0" } }, - "experimental/packages/sdk-events/node_modules/@opentelemetry/api-events": { - "version": "0.52.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-events/-/api-events-0.52.0.tgz", - "integrity": "sha512-+LdOC1OK9tINoj6KQT0FZkX3enQElzLkuwAbzF7Lrdp7x7XrhQFhMz7PwfTYCgnVDOqc7pRGw0jIfmj+vJ5t4g==", - "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/api-logs": "0.52.0" - }, - "engines": { - "node": ">=14" - } - }, - "experimental/packages/sdk-events/node_modules/@opentelemetry/api-logs": { - "version": "0.52.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.52.0.tgz", - "integrity": "sha512-HxjD7xH9iAE4OyhNaaSec65i1H6QZYBWSwWkowFfsc5YAcDvJG30/J1sRKXEQqdmUcKTXEAnA66UciqZha/4+Q==", - "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, "experimental/packages/sdk-events/node_modules/@types/sinon": { "version": "10.0.20", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.20.tgz", @@ -1492,7 +1465,6 @@ "@babel/core": "7.25.2", "@babel/preset-env": "7.25.4", "@opentelemetry/api": ">=1.4.0 <1.10.0", - "@opentelemetry/api-logs": "0.52.0", "@opentelemetry/resources_1.9.0": "npm:@opentelemetry/resources@1.9.0", "@types/mocha": "10.0.8", "@types/node": "18.6.5", @@ -1531,18 +1503,6 @@ "node": ">=8.0.0" } }, - "experimental/packages/sdk-logs/node_modules/@opentelemetry/api-logs": { - "version": "0.52.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.52.0.tgz", - "integrity": "sha512-HxjD7xH9iAE4OyhNaaSec65i1H6QZYBWSwWkowFfsc5YAcDvJG30/J1sRKXEQqdmUcKTXEAnA66UciqZha/4+Q==", - "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, "experimental/packages/sdk-logs/node_modules/@opentelemetry/resources_1.9.0": { "name": "@opentelemetry/resources", "version": "1.9.0", @@ -33675,8 +33635,8 @@ "requires": { "@babel/core": "7.25.2", "@opentelemetry/api": "1.9.0", - "@opentelemetry/api-events": "0.52.0", - "@opentelemetry/api-logs": "0.52.0", + "@opentelemetry/api-events": "0.53.0", + "@opentelemetry/api-logs": "0.53.0", "@opentelemetry/sdk-logs": "0.53.0", "@types/mocha": "10.0.8", "@types/node": "18.6.5", @@ -33702,25 +33662,6 @@ "webpack-merge": "5.10.0" }, "dependencies": { - "@opentelemetry/api-events": { - "version": "0.52.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-events/-/api-events-0.52.0.tgz", - "integrity": "sha512-+LdOC1OK9tINoj6KQT0FZkX3enQElzLkuwAbzF7Lrdp7x7XrhQFhMz7PwfTYCgnVDOqc7pRGw0jIfmj+vJ5t4g==", - "dev": true, - "requires": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/api-logs": "0.52.0" - } - }, - "@opentelemetry/api-logs": { - "version": "0.52.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.52.0.tgz", - "integrity": "sha512-HxjD7xH9iAE4OyhNaaSec65i1H6QZYBWSwWkowFfsc5YAcDvJG30/J1sRKXEQqdmUcKTXEAnA66UciqZha/4+Q==", - "dev": true, - "requires": { - "@opentelemetry/api": "^1.0.0" - } - }, "@types/sinon": { "version": "10.0.20", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.20.tgz", @@ -33738,7 +33679,7 @@ "@babel/core": "7.25.2", "@babel/preset-env": "7.25.4", "@opentelemetry/api": ">=1.4.0 <1.10.0", - "@opentelemetry/api-logs": "0.52.0", + "@opentelemetry/api-logs": "0.53.0", "@opentelemetry/core": "1.26.0", "@opentelemetry/resources": "1.26.0", "@opentelemetry/resources_1.9.0": "npm:@opentelemetry/resources@1.9.0", @@ -33770,15 +33711,6 @@ "integrity": "sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA==", "dev": true }, - "@opentelemetry/api-logs": { - "version": "0.52.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.52.0.tgz", - "integrity": "sha512-HxjD7xH9iAE4OyhNaaSec65i1H6QZYBWSwWkowFfsc5YAcDvJG30/J1sRKXEQqdmUcKTXEAnA66UciqZha/4+Q==", - "dev": true, - "requires": { - "@opentelemetry/api": "^1.0.0" - } - }, "@opentelemetry/resources_1.9.0": { "version": "npm:@opentelemetry/resources@1.9.0", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.9.0.tgz",