Diff

mod_prometheus/mod_prometheus.lua @ 3127:36770ae1148f

mod_prometheus: Don’t shadow variables. [luacheck]
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 21 Jun 2018 22:14:12 +0200
parent 3126:888375de933c
child 3128:a34e7bd87b39
line wrap: on
line diff
--- a/mod_prometheus/mod_prometheus.lua	Thu Jun 21 22:11:01 2018 +0200
+++ b/mod_prometheus/mod_prometheus.lua	Thu Jun 21 22:14:12 2018 +0200
@@ -102,17 +102,17 @@
 	local response = event.response;
 	response.headers.content_type = "text/plain; version=0.4.4";
 
-	local response = {};
+	local answer = {};
 	local timestamp = tostring(get_timestamp());
-	for section, data in pairs(data.data) do
-		for key, value in pairs(data) do
+	for section, content in pairs(data.data) do
+		for key, value in pairs(content) do
 			local name = "prosody_"..section.."_"..key;
-			t_insert(response, repr_help(name, "TODO: add a description here."));
-			t_insert(response, repr_type(name, "gauge"));
-			t_insert(response, repr_sample(name, {}, value, timestamp));
+			t_insert(answer, repr_help(name, "TODO: add a description here."));
+			t_insert(answer, repr_type(name, "gauge"));
+			t_insert(answer, repr_sample(name, {}, value, timestamp));
 		end
 	end
-	return table.concat(response, "");
+	return table.concat(answer, "");
 end
 
 function module.add_host(module)