Diff

core/moduleapi.lua @ 11931:c65d5da8e99a

mod_admin_shell: List collected metrics in module:info Lets you know what to look for with stats:show()
author Kim Alvefur <zash@zash.se>
date Wed, 24 Nov 2021 20:03:38 +0100
parent 11921:89aef37fca54
child 11987:4b519c575ad0
line wrap: on
line diff
--- a/core/moduleapi.lua	Tue Nov 23 17:59:40 2021 +0100
+++ b/core/moduleapi.lua	Wed Nov 24 20:03:38 2021 +0100
@@ -531,6 +531,7 @@
 	-- an array of labels
 	-- the prosody_ prefix is automatically added by statsmanager for legacy
 	-- metrics.
+	self:add_item("measure", { name = name, type = stat_type, conf = conf });
 	return measure(stat_type, "mod_"..self.name.."/"..name, conf, fixed_label_key, fixed_label_value)
 end
 
@@ -544,6 +545,7 @@
 		label_keys:append(orig_labels)
 	end
 	local mf = metric(type_, "prosody_mod_"..self.name.."/"..name, unit, description, label_keys, conf)
+	self:add_item("metric", { name = name, mf = mf });
 	if is_scoped then
 		-- make sure to scope the returned metric family to the current host
 		return mf:with_partial_label(self.host)