synapse/synapse/media
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
..
_base.py Reduce log spam when client stops downloading media while it is being streamed to them (ConsumerStopProducingError) (#18699) 2025-07-21 20:11:46 +00:00
filepath.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
media_repository.py Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
media_storage.py Store hashes of media files, and allow quarantining by hash. (#18277) 2025-03-27 17:26:34 +00:00
oembed.py Bump lxml-stubs from 0.4.0 to 0.5.1 (#16885) 2024-02-06 09:29:17 +00:00
preview_html.py Update URL Preview code to work with lxml 6.0.0 (#18622) 2025-07-15 15:04:29 +01:00
storage_provider.py Use a larger, dedicated threadpool for media sending (#17564) 2024-08-13 17:59:47 +01:00
thumbnailer.py Add caching support to media endpoints (#18235) 2025-03-13 16:28:19 +00:00
url_previewer.py Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00