From 2a3c26437f536201d0d9e440d2593f17ad37f8d4 Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Thu, 18 Jan 2024 04:46:04 +0100 Subject: [PATCH] refactor(core): drop unnecessary assignment of HOSTNAME (#4421) * fix(core): drop unnecessary assignemnt of HOSTNAME * fix(changelog): add changelog entry * Update CHANGELOG.md * fix(changelog): move entry to internal --- CHANGELOG.md | 1 + .../opentelemetry-core/src/platform/node/environment.ts | 9 +-------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7079975e3d..1df51ee2e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/ ### :house: (Internal) * chore(opentelemetry-context-zone-peer-dep): support zone.js ^v0.13.0 [#4320](https://github.com/open-telemetry/opentelemetry-js/pull/4320) +* refactor(core): drop unnecessary assignment of HOSTNAME [#4421](https://github.com/open-telemetry/opentelemetry-js/pull/4421) @pichlermarc ## 1.20.0 diff --git a/packages/opentelemetry-core/src/platform/node/environment.ts b/packages/opentelemetry-core/src/platform/node/environment.ts index 749633f08b..48658693fe 100644 --- a/packages/opentelemetry-core/src/platform/node/environment.ts +++ b/packages/opentelemetry-core/src/platform/node/environment.ts @@ -14,7 +14,6 @@ * limitations under the License. */ -import * as os from 'os'; import { DEFAULT_ENVIRONMENT, ENVIRONMENT, @@ -27,11 +26,5 @@ import { */ export function getEnv(): Required { const processEnv = parseEnvironment(process.env as RAW_ENVIRONMENT); - return Object.assign( - { - HOSTNAME: os.hostname(), - }, - DEFAULT_ENVIRONMENT, - processEnv - ); + return Object.assign({}, DEFAULT_ENVIRONMENT, processEnv); }