summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-12-10 16:31:24 +0000
committerGitHub <noreply@github.com>2019-12-10 16:31:24 +0000
commitb2dcddc4135b067b1ff37d65b18256ba294e462d (patch)
tree469ce283586e696cddf679735bdc7ea74d33b806
parentFix race which caused deleted devices to reappear (#6514) (diff)
parentNewsfile (diff)
downloadsynapse-b2dcddc4135b067b1ff37d65b18256ba294e462d.tar.xz
Merge pull request #6510 from matrix-org/erikj/phone_home_stats_db
Phone home stats DB reporting should not assume a single DB.
-rw-r--r--changelog.d/6510.misc1
-rw-r--r--synapse/app/homeserver.py6
2 files changed, 5 insertions, 2 deletions
diff --git a/changelog.d/6510.misc b/changelog.d/6510.misc
new file mode 100644
index 0000000000..214f06539b
--- /dev/null
+++ b/changelog.d/6510.misc
@@ -0,0 +1 @@
+Change phone home stats to not assume there is a single database and report information about the database used by the main data store.
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index df65d0a989..032010600a 100644
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -519,8 +519,10 @@ def phone_stats_home(hs, stats, stats_process=_stats_process):
     # Database version
     #
 
-    stats["database_engine"] = hs.database_engine.module.__name__
-    stats["database_server_version"] = hs.database_engine.server_version
+    # This only reports info about the *main* database.
+    stats["database_engine"] = hs.get_datastore().db.engine.module.__name__
+    stats["database_server_version"] = hs.get_datastore().db.engine.server_version
+
     logger.info("Reporting stats to %s: %s" % (hs.config.report_stats_endpoint, stats))
     try:
         yield hs.get_proxied_http_client().put_json(