diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2022-09-05 12:26:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-05 10:26:43 +0000 |
commit | 898fef2789c9b1a20ef53c7d588f536f51f0fe2f (patch) | |
tree | 326f374fa50f2418f7ab13cdfc21c92da613291d /synapse/server.py | |
parent | fix grammar (diff) | |
download | synapse-898fef2789c9b1a20ef53c7d588f536f51f0fe2f.tar.xz |
Share some metrics between the Prometheus exporter and the phone home stats (#13671)
Diffstat (limited to 'synapse/server.py')
-rw-r--r-- | synapse/server.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/server.py b/synapse/server.py index c2e55bf0b1..5a99c0b344 100644 --- a/synapse/server.py +++ b/synapse/server.py @@ -105,6 +105,7 @@ from synapse.handlers.typing import FollowerTypingHandler, TypingWriterHandler from synapse.handlers.user_directory import UserDirectoryHandler from synapse.http.client import InsecureInterceptableContextFactory, SimpleHttpClient from synapse.http.matrixfederationclient import MatrixFederationHttpClient +from synapse.metrics.common_usage_metrics import CommonUsageMetricsManager from synapse.module_api import ModuleApi from synapse.notifier import Notifier from synapse.push.bulk_push_rule_evaluator import BulkPushRuleEvaluator @@ -829,3 +830,8 @@ class HomeServer(metaclass=abc.ABCMeta): self.config.ratelimiting.rc_message, self.config.ratelimiting.rc_admin_redaction, ) + + @cache_in_self + def get_common_usage_metrics_manager(self) -> CommonUsageMetricsManager: + """Usage metrics shared between phone home stats and the prometheus exporter.""" + return CommonUsageMetricsManager(self) |