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: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F5041%2Fhead;p=thirdparty%2Frspamd.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 75885516c3..3de87c157a 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')