summary refs log tree commit diff
path: root/synapse/metrics
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-05-31 19:04:50 +1000
committerGitHub <noreply@github.com>2018-05-31 19:04:50 +1000
commitfebe0ec8fd78028fe7c7b3a26a8dd85c32ee1550 (patch)
tree2113033f9f601fc723a47b45ef8f2652ef68cc6d /synapse/metrics
parentConsistently use six's iteritems and wrap lazy keys/values in list() if they'... (diff)
downloadsynapse-febe0ec8fd78028fe7c7b3a26a8dd85c32ee1550.tar.xz
Run Prometheus on a different port, optionally. (#3274)
Diffstat (limited to '')
-rw-r--r--synapse/metrics/__init__.py3
-rw-r--r--synapse/metrics/resource.py4
2 files changed, 6 insertions, 1 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py
index bfdbbc9a23..56c0032f91 100644
--- a/synapse/metrics/__init__.py
+++ b/synapse/metrics/__init__.py
@@ -39,7 +39,8 @@ HAVE_PROC_SELF_STAT = os.path.exists("/proc/self/stat")
 
 class RegistryProxy(object):
 
-    def collect(self):
+    @staticmethod
+    def collect():
         for metric in REGISTRY.collect():
             if not metric.name.startswith("__"):
                 yield metric
diff --git a/synapse/metrics/resource.py b/synapse/metrics/resource.py
index 7996e6ab66..9789359077 100644
--- a/synapse/metrics/resource.py
+++ b/synapse/metrics/resource.py
@@ -13,4 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from prometheus_client.twisted import MetricsResource
+
 METRICS_PREFIX = "/_synapse/metrics"
+
+__all__ = ["MetricsResource", "METRICS_PREFIX"]