diff mod_prometheus/mod_prometheus.lua @ 3133:321fd53a3191

mod_prometheus: Put the name as a label, which fits better the usual Prosody model.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 22 Jun 2018 00:38:37 +0200
parents 4ef28b6b4e87
children 99ac6dda9878
line wrap: on
line diff
--- a/mod_prometheus/mod_prometheus.lua	Fri Jun 22 00:32:05 2018 +0200
+++ b/mod_prometheus/mod_prometheus.lua	Fri Jun 22 00:38:37 2018 +0200
@@ -80,10 +80,10 @@
 			sect = sect:sub(16);
 		end
 
-		local key = escape_name("prosody_"..sect.."_"..name);
+		local key = escape_name("prosody_"..sect);
 		local field = {
 			value = value,
-			labels = {},
+			labels = { ["type"] = name},
 			-- TODO: Use the other types where it makes sense.
 			typ = (typ == "rate" and "counter" or "gauge"),
 		};