From 6d9477b6f767afc7cea41bde8c76eef730aa212c Mon Sep 17 00:00:00 2001 From: Quin Bedard Date: Tue, 2 Jul 2024 12:16:48 -0500 Subject: [PATCH] fix(auto-instrumentations-node): check if detector key in map rather than value false-iness --- metapackages/auto-instrumentations-node/src/utils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/metapackages/auto-instrumentations-node/src/utils.ts b/metapackages/auto-instrumentations-node/src/utils.ts index c258dfc597..5372f5e92a 100644 --- a/metapackages/auto-instrumentations-node/src/utils.ts +++ b/metapackages/auto-instrumentations-node/src/utils.ts @@ -273,12 +273,11 @@ export function getResourceDetectorsFromEnv(): Array { } return resourceDetectorsFromEnv.flatMap(detector => { - const resourceDetector = resourceDetectors.get(detector); - if (!resourceDetector) { + if (!resourceDetectors.has(detector)) { diag.error( `Invalid resource detector "${detector}" specified in the environment variable OTEL_NODE_RESOURCE_DETECTORS` ); } - return resourceDetector || []; + return resourceDetectors.get(detector) || []; }); }