Skip to content

Commit

Permalink
allow 0 value as a valid value for set() and observe()
Browse files Browse the repository at this point in the history
  • Loading branch information
ymartin-ovh committed Aug 26, 2024
1 parent 1c26a72 commit 31acb01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prometheus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ end
-- value: numeric value.
-- label_values: a list of label values, in the same order as label keys.
local function set(self, value, label_values)
if not value then
if type(value) ~= "number" then
self._log_error("No value passed for " .. self.name)
return
end
Expand All @@ -573,7 +573,7 @@ end
-- value: numeric value to record. Should be defined.
-- label_values: a list of label values, in the same order as label keys.
local function observe(self, value, label_values)
if not value then
if type(value) ~= "number" then
self._log_error("No value passed for " .. self.name)
return
end
Expand Down

0 comments on commit 31acb01

Please sign in to comment.