commit 2f9eebd: [Fix] metric_exporter: avoid sending `nil` in metric values

Andrew Lewis nerf at judo.za.org
Mon Jul 29 17:59:01 UTC 2024


Author: Andrew Lewis
Date: 2024-07-08 16:05:52 +0200
URL: https://github.com/rspamd/rspamd/commit/2f9eebdf46e4c4bf7c2cb06724c1697431ce73bb (refs/pull/5041/head)

[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')


More information about the Commits mailing list