Share some metrics between the Prometheus exporter and the phone home stats (#13671)

This commit is contained in:
Brendan Abolivier 2022-09-05 12:26:43 +02:00 committed by GitHub
parent ad7fc8e92f
commit 898fef2789
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 146 additions and 4 deletions

View file

@ -511,9 +511,10 @@ async def start(hs: "HomeServer") -> None:
setup_sentry(hs)
setup_sdnotify(hs)
# If background tasks are running on the main process, start collecting the
# phone home stats.
# If background tasks are running on the main process or this is the worker in
# charge of them, start collecting the phone home stats and shared usage metrics.
if hs.config.worker.run_background_tasks:
await hs.get_common_usage_metrics_manager().setup()
start_phone_stats_home(hs)
# We now freeze all allocated objects in the hopes that (almost)