synapse/synapse
Eric Eastwood b7e7f537f1
Refactor background process metrics to be homeserver-scoped (#18670)
Part of https://github.com/element-hq/synapse/issues/18592

Separated out of https://github.com/element-hq/synapse/pull/18656
because it's a bigger, unique piece of the refactor


### Testing strategy

 1. Add the `metrics` listener in your `homeserver.yaml`
    ```yaml
    listeners:
      # This is just showing how to configure metrics either way
      #
      # `http` `metrics` resource
      - port: 9322
        type: http
        bind_addresses: ['127.0.0.1']
        resources:
          - names: [metrics]
            compress: false
      # `metrics` listener
      - port: 9323
        type: metrics
        bind_addresses: ['127.0.0.1']
    ```
1. Start the homeserver: `poetry run synapse_homeserver --config-path
homeserver.yaml`
1. Fetch `http://localhost:9322/_synapse/metrics` and/or
`http://localhost:9323/metrics`
1. Observe response includes the background processs metrics
(`synapse_background_process_start_count`,
`synapse_background_process_db_txn_count_total`, etc) with the
`server_name` label
2025-07-23 13:28:17 -05:00
..
_scripts Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
api Dedicated MAS API (#18520) 2025-07-21 16:17:43 +00:00
app Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
appservice Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
config Add support for MSC4293 - Redact on Kick/Ban (#18540) 2025-07-23 16:00:01 +01:00
crypto Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
events Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
federation Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
handlers Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
http Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
logging Add debug log when HMAC incorrect (#18474) 2025-07-22 11:09:45 -05:00
media Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
metrics Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
module_api Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
push Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
replication Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
res Send an email if the address is already bound to an user account (#16819) 2024-04-23 16:45:24 +01:00
rest Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
server_notices Refactor cache metrics to be homeserver-scoped (#18604) 2025-07-16 16:04:57 -05:00
spam_checker_api Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
state Refactor cache metrics to be homeserver-scoped (#18604) 2025-07-16 16:04:57 -05:00
static Update link to the clients webpage, fix #15825 (#15874) 2023-07-06 17:28:09 +02:00
storage Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
streams Move device changes off the main process (#18581) 2025-07-18 09:06:14 +02:00
synapse_rust Start and stop the Tokio runtime with the Twisted reactor (#18691) 2025-07-17 15:15:11 +00:00
types Add experimental and incomplete support for MSC4306: Thread Subscriptions. (#18674) 2025-07-21 15:54:28 +01:00
util Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
__init__.py Remove support for python 3.8 (#17908) 2024-11-06 19:36:01 +00:00
_pydantic_compat.py Dedicated MAS API (#18520) 2025-07-21 16:17:43 +00:00
event_auth.py bugfix: assert we always pass the create event to get_user_power_level (#18545) 2025-06-13 16:32:24 +00:00
notifier.py remove room without listeners from Notifier.room_to_user_streams (#18380) 2025-05-15 18:18:17 +01:00
py.typed
server.py Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
visibility.py Allow admins to see soft failed events (if they want to) (#18238) 2025-07-14 16:55:19 +01:00