# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1653925045 -7200
# Node ID 7ef7abb72cdd2a1baf59eb2b455e7f7da2743080
# Parent  3caff1f935206618305b3154e7e32cb7e05ae8e1
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!

diff -r 3caff1f93520 -r 7ef7abb72cdd util/openmetrics.lua
--- a/util/openmetrics.lua	Mon May 30 17:34:58 2022 +0200
+++ b/util/openmetrics.lua	Mon May 30 17:37:25 2022 +0200
@@ -35,6 +35,7 @@
 -- `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 @@
 -- 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 @@
 end
 
 local metric_registry_mt = {}
+metric_registry_mt.__name = "metric_registry"
 metric_registry_mt.__index = metric_registry_mt
 
 local function new_metric_registry(backend)