From 12d39d638b08173d688e46cfce14750ef93e81b1 Mon Sep 17 00:00:00 2001 From: Jackson Weber Date: Mon, 4 Dec 2023 14:00:03 -0800 Subject: [PATCH] fix: update so that functions is only detected if functionversion is set. --- .../src/detectors/AzureFunctionsDetector.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/detectors/node/opentelemetry-resource-detector-azure/src/detectors/AzureFunctionsDetector.ts b/detectors/node/opentelemetry-resource-detector-azure/src/detectors/AzureFunctionsDetector.ts index 8cd601edb3..2a695fd2d6 100644 --- a/detectors/node/opentelemetry-resource-detector-azure/src/detectors/AzureFunctionsDetector.ts +++ b/detectors/node/opentelemetry-resource-detector-azure/src/detectors/AzureFunctionsDetector.ts @@ -44,8 +44,8 @@ class AzureFunctionsDetector implements DetectorSync { detect(): IResource { let attributes = {}; const functionName = process.env[WEBSITE_SITE_NAME]; - if (functionName) { - const functionVersion = process.env[FUNCTIONS_VERSION]; + const functionVersion = process.env[FUNCTIONS_VERSION]; + if (functionName && functionVersion) { const functionInstance = process.env[WEBSITE_INSTANCE_ID]; const functionMemLimit = process.env[FUNCTIONS_MEM_LIMIT];