Skip to content

Commit

Permalink
allow null and undefined values for labels
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Jun 21, 2024
1 parent 592f0f2 commit 9a258e6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/guard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit 9a258e6

Please sign in to comment.