From 9a258e6cd37738c74d200a853db62cc9208b035c Mon Sep 17 00:00:00 2001 From: William Killerud Date: Fri, 21 Jun 2024 14:30:56 +0200 Subject: [PATCH] allow null and undefined values for labels --- lib/guard.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/guard.js b/lib/guard.js index 3d0a84d..cf9758a 100644 --- a/lib/guard.js +++ b/lib/guard.js @@ -139,13 +139,7 @@ const MetricsGuard = class MetricsGuard extends stream.Transform { // Set for the metric in the registry. the size of // this Set is compared with the threshold metric.labels.forEach((label) => { - if ( - label && - (label.name === null || - typeof label.name === "undefined" || - label.value === null || - typeof label.value === "undefined") - ) { + if (label && (label.name === null || typeof label.name === "undefined")) { hasInvalidLabelValue.push(`${metric.name} label name="${label.name}", value=${label.value}`); } else { entry.add(`${label.name}${SEPARATOR}${label.value}`);