diff options
author | Kim Alvefur <zash@zash.se> | 2022-05-30 17:37:25 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2022-05-30 17:37:25 +0200 |
commit | 677d77e82e0bae7d8d94c910df07ad82fdbcab6d (patch) | |
tree | 354f76099dea10af9e529042b52961a17611d558 | |
parent | b78c9e7f5f1ad2e696a76e01e8af70c0eda84246 (diff) | |
download | prosody-677d77e82e0bae7d8d94c910df07ad82fdbcab6d.tar.gz prosody-677d77e82e0bae7d8d94c910df07ad82fdbcab6d.zip |
util.openmetrics: Set __name field on metatables to improve error messages
Don't think we cause any such errors right now, but you never know!
-rw-r--r-- | util/openmetrics.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/openmetrics.lua b/util/openmetrics.lua index c18e63e9..634f9de1 100644 --- a/util/openmetrics.lua +++ b/util/openmetrics.lua @@ -35,6 +35,7 @@ local t_pack, t_unpack = require "util.table".pack, table.unpack or unpack; --lu -- `with_partial_label` by the moduleapi in order to pre-set the `host` label -- on metrics created in non-global modules. local metric_proxy_mt = {} +metric_proxy_mt.__name = "metric_proxy" metric_proxy_mt.__index = metric_proxy_mt local function new_metric_proxy(metric_family, with_labels_proxy_fun) @@ -128,6 +129,7 @@ end -- BEGIN of generic MetricFamily implementation local metric_family_mt = {} +metric_family_mt.__name = "metric_family" metric_family_mt.__index = metric_family_mt local function histogram_metric_ctor(orig_ctor, buckets) @@ -278,6 +280,7 @@ local function compose_name(name, unit) end local metric_registry_mt = {} +metric_registry_mt.__name = "metric_registry" metric_registry_mt.__index = metric_registry_mt local function new_metric_registry(backend) |