From 6515ed8098333646a63a74a8c0150cc2daf520db Mon Sep 17 00:00:00 2001 From: David Luna Date: Fri, 20 Sep 2024 13:54:22 +0200 Subject: [PATCH] refactor(sdk-logs): replace ResourceAtrributes with Attributes (#5005) Co-authored-by: Marc Pichler --- experimental/CHANGELOG.md | 1 + .../test/common/export/BatchLogRecordProcessor.test.ts | 5 +++-- .../test/common/export/SimpleLogRecordProcessor.test.ts | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 956fd01e23..4ac335a9cc 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -24,6 +24,7 @@ All notable changes to experimental packages in this project will be documented * refactor(exporter-prometheus): replace `MetricAttributes` and `MetricAttributeValues` with `Attributes` and `AttributeValues` [#4993](https://github.com/open-telemetry/opentelemetry-js/pull/4993) * refactor(browser-detector): replace `ResourceAttributes` with `Attributes` [#5004](https://github.com/open-telemetry/opentelemetry-js/pull/5004) +* refactor(sdk-logs): replace `ResourceAttributes` with `Attributes` [#5005](https://github.com/open-telemetry/opentelemetry-js/pull/5005) @david-luna ## 0.53.0 diff --git a/experimental/packages/sdk-logs/test/common/export/BatchLogRecordProcessor.test.ts b/experimental/packages/sdk-logs/test/common/export/BatchLogRecordProcessor.test.ts index f6a8e77611..46e086d92b 100644 --- a/experimental/packages/sdk-logs/test/common/export/BatchLogRecordProcessor.test.ts +++ b/experimental/packages/sdk-logs/test/common/export/BatchLogRecordProcessor.test.ts @@ -32,7 +32,8 @@ import { import { BatchLogRecordProcessorBase } from '../../../src/export/BatchLogRecordProcessorBase'; import { reconfigureLimits } from '../../../src/config'; import { LoggerProviderSharedState } from '../../../src/internal/LoggerProviderSharedState'; -import { Resource, ResourceAttributes } from '@opentelemetry/resources'; +import { Attributes } from '@opentelemetry/api'; +import { Resource } from '@opentelemetry/resources'; class BatchLogRecordProcessor extends BatchLogRecordProcessorBase { onInit() {} @@ -316,7 +317,7 @@ describe('BatchLogRecordProcessorBase', () => { const processor = new BatchLogRecordProcessor(exporter); const asyncResource = new Resource( {}, - new Promise(resolve => { + new Promise(resolve => { setTimeout(() => resolve({ async: 'fromasync' }), 1); }) ); diff --git a/experimental/packages/sdk-logs/test/common/export/SimpleLogRecordProcessor.test.ts b/experimental/packages/sdk-logs/test/common/export/SimpleLogRecordProcessor.test.ts index a19723f4cc..193f6038b9 100644 --- a/experimental/packages/sdk-logs/test/common/export/SimpleLogRecordProcessor.test.ts +++ b/experimental/packages/sdk-logs/test/common/export/SimpleLogRecordProcessor.test.ts @@ -21,7 +21,8 @@ import { loggingErrorHandler, setGlobalErrorHandler, } from '@opentelemetry/core'; -import { Resource, ResourceAttributes } from '@opentelemetry/resources'; +import { Attributes } from '@opentelemetry/api'; +import { Resource } from '@opentelemetry/resources'; import { Resource as Resource190 } from '@opentelemetry/resources_1.9.0'; import { @@ -121,7 +122,7 @@ describe('SimpleLogRecordProcessor', () => { const exporter = new InMemoryLogRecordExporter(); const asyncResource = new Resource( {}, - new Promise(resolve => { + new Promise(resolve => { setTimeout(() => resolve({ async: 'fromasync' }), 1); }) ); @@ -143,7 +144,7 @@ describe('SimpleLogRecordProcessor', () => { const testExporterWithDelay = new TestExporterWithDelay(); const asyncResource = new Resource( {}, - new Promise(resolve => { + new Promise(resolve => { setTimeout(() => resolve({ async: 'fromasync' }), 1); }) );