summary refs log tree commit diff
path: root/synapse/metrics/__init__.py
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-05-22 10:50:26 -0500
committerAmber Brown <hawkowl@atleastfornow.net>2018-05-22 10:50:26 -0500
commita8990fa2ec98ea14493515a92d6228729024409b (patch)
treea0ce94c793d02e80ac95ec43a16c3b11a1884efa /synapse/metrics/__init__.py
parentrest of the changes (diff)
parentMerge pull request #3262 from matrix-org/rav/has_already_consented (diff)
downloadsynapse-a8990fa2ec98ea14493515a92d6228729024409b.tar.xz
Merge remote-tracking branch 'origin/develop' into 3218-official-prom
Diffstat (limited to 'synapse/metrics/__init__.py')
-rw-r--r--synapse/metrics/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py
index 973ba6506f..ab0b921497 100644
--- a/synapse/metrics/__init__.py
+++ b/synapse/metrics/__init__.py
@@ -62,8 +62,12 @@ class LaterGauge(object):
 
         yield g
 
-    def register(self):
+    def __attrs_post_init__(self):
+        self._register()
+
+    def _register(self):
         if self.name in all_gauges.keys():
+            logger.warning("%s already registered, reregistering" % (self.name,))
             REGISTRY.unregister(all_gauges.pop(self.name))
 
         REGISTRY.register(self)