Skip to content
Snippets Groups Projects
Unverified Commit b25e387c authored by Neil Johnson's avatar Neil Johnson Committed by GitHub
Browse files

add context to phonehome stats (#5020)

add context to phonehome stats
parent 67d7b447
No related branches found
No related tags found
No related merge requests found
Add context to phonehome stats.
...@@ -236,6 +236,9 @@ listeners: ...@@ -236,6 +236,9 @@ listeners:
# - medium: 'email' # - medium: 'email'
# address: 'reserved_user@example.com' # address: 'reserved_user@example.com'
# Used by phonehome stats to group together related servers.
#server_context: context
## TLS ## ## TLS ##
......
...@@ -518,6 +518,7 @@ def run(hs): ...@@ -518,6 +518,7 @@ def run(hs):
uptime = 0 uptime = 0
stats["homeserver"] = hs.config.server_name stats["homeserver"] = hs.config.server_name
stats["server_context"] = hs.config.server_context
stats["timestamp"] = now stats["timestamp"] = now
stats["uptime_seconds"] = uptime stats["uptime_seconds"] = uptime
version = sys.version_info version = sys.version_info
...@@ -558,7 +559,6 @@ def run(hs): ...@@ -558,7 +559,6 @@ def run(hs):
stats["database_engine"] = hs.get_datastore().database_engine_name stats["database_engine"] = hs.get_datastore().database_engine_name
stats["database_server_version"] = hs.get_datastore().get_server_version() stats["database_server_version"] = hs.get_datastore().get_server_version()
logger.info("Reporting stats to matrix.org: %s" % (stats,)) logger.info("Reporting stats to matrix.org: %s" % (stats,))
try: try:
yield hs.get_simple_http_client().put_json( yield hs.get_simple_http_client().put_json(
......
...@@ -37,6 +37,7 @@ class ServerConfig(Config): ...@@ -37,6 +37,7 @@ class ServerConfig(Config):
def read_config(self, config): def read_config(self, config):
self.server_name = config["server_name"] self.server_name = config["server_name"]
self.server_context = config.get("server_context", None)
try: try:
parse_and_validate_server_name(self.server_name) parse_and_validate_server_name(self.server_name)
...@@ -484,6 +485,9 @@ class ServerConfig(Config): ...@@ -484,6 +485,9 @@ class ServerConfig(Config):
#mau_limit_reserved_threepids: #mau_limit_reserved_threepids:
# - medium: 'email' # - medium: 'email'
# address: 'reserved_user@example.com' # address: 'reserved_user@example.com'
# Used by phonehome stats to group together related servers.
#server_context: context
""" % locals() """ % locals()
def read_arguments(self, args): def read_arguments(self, args):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment