diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d9b3f9363..4b7418f59c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/ ### :bug: (Bug Fix) * fix(resource): make properties for async resource resolution optional [#3677](https://github.com/open-telemetry/opentelemetry-js/pull/3677) @pichlermarc +* fix(resources): change fs/promises import to be node 12 compatible [#3681](https://github.com/open-telemetry/opentelemetry-js/pull/3681) @pichlermarc ### :books: (Refine Doc) diff --git a/packages/opentelemetry-resources/src/platform/node/machine-id/getMachineId-bsd.ts b/packages/opentelemetry-resources/src/platform/node/machine-id/getMachineId-bsd.ts index edd04c7f1b..eb6dd1be41 100644 --- a/packages/opentelemetry-resources/src/platform/node/machine-id/getMachineId-bsd.ts +++ b/packages/opentelemetry-resources/src/platform/node/machine-id/getMachineId-bsd.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import * as fs from 'fs/promises'; +import { promises as fs } from 'fs'; import { execAsync } from './execAsync'; import { diag } from '@opentelemetry/api'; diff --git a/packages/opentelemetry-resources/src/platform/node/machine-id/getMachineId-linux.ts b/packages/opentelemetry-resources/src/platform/node/machine-id/getMachineId-linux.ts index 74b145a2f4..9ebfe58e81 100644 --- a/packages/opentelemetry-resources/src/platform/node/machine-id/getMachineId-linux.ts +++ b/packages/opentelemetry-resources/src/platform/node/machine-id/getMachineId-linux.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import * as fs from 'fs/promises'; +import { promises as fs } from 'fs'; import { diag } from '@opentelemetry/api'; export async function getMachineId(): Promise { diff --git a/packages/opentelemetry-resources/test/detectors/node/machine-id/getMachineId-bsd.test.ts b/packages/opentelemetry-resources/test/detectors/node/machine-id/getMachineId-bsd.test.ts index 317132a968..ba60b1a944 100644 --- a/packages/opentelemetry-resources/test/detectors/node/machine-id/getMachineId-bsd.test.ts +++ b/packages/opentelemetry-resources/test/detectors/node/machine-id/getMachineId-bsd.test.ts @@ -16,7 +16,7 @@ import * as sinon from 'sinon'; import * as assert from 'assert'; -import * as fs from 'fs/promises'; +import { promises as fs } from 'fs'; import { PromiseWithChild } from 'child_process'; import * as util from '../../../../src/platform/node/machine-id/execAsync'; import { getMachineId } from '../../../../src/platform/node/machine-id/getMachineId-bsd'; diff --git a/packages/opentelemetry-resources/test/detectors/node/machine-id/getMachineId-linux.test.ts b/packages/opentelemetry-resources/test/detectors/node/machine-id/getMachineId-linux.test.ts index d8dfe4d1da..41526db379 100644 --- a/packages/opentelemetry-resources/test/detectors/node/machine-id/getMachineId-linux.test.ts +++ b/packages/opentelemetry-resources/test/detectors/node/machine-id/getMachineId-linux.test.ts @@ -16,7 +16,7 @@ import * as sinon from 'sinon'; import * as assert from 'assert'; -import * as fs from 'fs/promises'; +import { promises as fs } from 'fs'; import { getMachineId } from '../../../../src/platform/node/machine-id/getMachineId-linux';