From: Andrew Lewis Date: Mon, 8 Jul 2024 14:05:52 +0000 (+0200) Subject: [Fix] metric_exporter: avoid sending `nil` in metric values X-Git-Tag: 3.9.0~8^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2f9eebdf46e4c4bf7c2cb06724c1697431ce73bb;p=rspamd.git [Fix] metric_exporter: avoid sending `nil` in metric values --- diff --git a/src/plugins/lua/metric_exporter.lua b/src/plugins/lua/metric_exporter.lua index 75885516c..3de87c157 100644 --- a/src/plugins/lua/metric_exporter.lua +++ b/src/plugins/lua/metric_exporter.lua @@ -117,7 +117,7 @@ local function graphite_push(kwargs) elseif #split == 2 then mvalue = kwargs['stats'][split[1]][split[2]] end - table.insert(metrics_str, string.format('%s %s %s', mname, mvalue, stamp)) + table.insert(metrics_str, string.format('%s %s %s', mname, mvalue or 'null', stamp)) end metrics_str = table.concat(metrics_str, '\n')