From 2f9eebdf46e4c4bf7c2cb06724c1697431ce73bb Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Mon, 8 Jul 2024 16:05:52 +0200 Subject: [PATCH] [Fix] metric_exporter: avoid sending `nil` in metric values --- src/plugins/lua/metric_exporter.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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') -- 2.39.5