add report_stats_endpoint config option (#6012)

This PR adds the optional `report_stats_endpoint` to configure where stats are reported to, if enabled.
This commit is contained in:
Sorunome 2019-09-12 12:24:57 +02:00 committed by Richard van der Hoff
parent a8251da10f
commit dd2e5b0038
4 changed files with 19 additions and 2 deletions

View file

@ -37,6 +37,9 @@ class MetricsConfig(Config):
def read_config(self, config, **kwargs):
self.enable_metrics = config.get("enable_metrics", False)
self.report_stats = config.get("report_stats", None)
self.report_stats_endpoint = config.get(
"report_stats_endpoint", "https://matrix.org/report-usage-stats/push"
)
self.metrics_port = config.get("metrics_port")
self.metrics_bind_host = config.get("metrics_bind_host", "127.0.0.1")
@ -95,4 +98,10 @@ class MetricsConfig(Config):
else:
res += "report_stats: %s\n" % ("true" if report_stats else "false")
res += """
# The endpoint to report the anonymized homeserver usage statistics to.
# Defaults to https://matrix.org/report-usage-stats/push
#
#report_stats_endpoint: https://example.com/report-usage-stats/push
"""
return res