From 56c21e9364bf4ced472986fdc20d1fd5477aa3ee Mon Sep 17 00:00:00 2001 From: Jakub Date: Thu, 9 May 2024 11:16:29 +0200 Subject: [PATCH] fix(resources): lint wait for async attributes for detecting resources --- packages/opentelemetry-resources/src/detect-resources.ts | 4 +--- .../opentelemetry-resources/test/detect-resources.test.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/opentelemetry-resources/src/detect-resources.ts b/packages/opentelemetry-resources/src/detect-resources.ts index a556107283..28ab5eeccf 100644 --- a/packages/opentelemetry-resources/src/detect-resources.ts +++ b/packages/opentelemetry-resources/src/detect-resources.ts @@ -70,9 +70,7 @@ export const detectResourcesSync = ( if (isPromiseLike(resourceOrPromise)) { const createPromise = async () => { const resolvedResource = await resourceOrPromise; - if (resolvedResource.waitForAsyncAttributes) { - await resolvedResource.waitForAsyncAttributes(); - } + // await resolvedResource.waitForAsyncAttributes?.(); return resolvedResource.attributes; }; resource = new Resource({}, createPromise()); diff --git a/packages/opentelemetry-resources/test/detect-resources.test.ts b/packages/opentelemetry-resources/test/detect-resources.test.ts index 6e804dea14..7c3b1a212c 100644 --- a/packages/opentelemetry-resources/test/detect-resources.test.ts +++ b/packages/opentelemetry-resources/test/detect-resources.test.ts @@ -30,7 +30,7 @@ describe('detectResourcesSync', () => { async detect() { return new Resource( { sync: 'fromsync' }, - Promise.resolve({ async: 'fromasync' }).then(attrs => attrs) + Promise.resolve().then(() => ({ async: 'fromasync' })) ); }, };