element-synapse/synapse
Eric Eastwood fc10a5ee29
Refactor Measure block metrics to be homeserver-scoped (v2) (#18601)
Refactor `Measure` block metrics to be homeserver-scoped (add
`server_name` label to block metrics).

Part of https://github.com/element-hq/synapse/issues/18592


### Testing strategy

#### See behavior of previous `metrics` listener

 1. Add the `metrics` listener in your `homeserver.yaml`
    ```yaml
    listeners:
      - 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:9323/metrics`
1. Observe response includes the block metrics
(`synapse_util_metrics_block_count`,
`synapse_util_metrics_block_in_flight`, etc)


#### See behavior of the `http` `metrics` resource

1. Add the `metrics` resource to a new or existing `http` listeners in
your `homeserver.yaml`
    ```yaml
    listeners:
      - port: 9322
        type: http
        bind_addresses: ['127.0.0.1']
        resources:
          - names: [metrics]
            compress: false
    ```
1. Start the homeserver: `poetry run synapse_homeserver --config-path
homeserver.yaml`
1. Fetch `http://localhost:9322/_synapse/metrics` (it's just a `GET`
request so you can even do in the browser)
1. Observe response includes the block metrics
(`synapse_util_metrics_block_count`,
`synapse_util_metrics_block_in_flight`, etc)
2025-07-15 15:55:23 -05:00
..
_scripts Bump ruff from 0.7.3 to 0.11.10 (#18451) 2025-05-20 15:23:30 +01:00
api Allow admins to see soft failed events (if they want to) (#18238) 2025-07-14 16:55:19 +01:00
app Move registrations off the main worker (#18552) 2025-07-10 13:13:27 +00:00
appservice Allow admins to see soft failed events (if they want to) (#18238) 2025-07-14 16:55:19 +01:00
config Bump mypy from 1.13.0 to 1.16.1 (#18653) 2025-07-15 14:42:54 +01:00
crypto Fix fetching signing keys when old_verify_keys is omitted (#17568) 2024-08-14 14:13:56 +01:00
events Allow admins to see soft failed events (if they want to) (#18238) 2025-07-14 16:55:19 +01:00
federation Refactor Measure block metrics to be homeserver-scoped (v2) (#18601) 2025-07-15 15:55:23 -05:00
handlers Refactor Measure block metrics to be homeserver-scoped (v2) (#18601) 2025-07-15 15:55:23 -05:00
http Refactor Measure block metrics to be homeserver-scoped (v2) (#18601) 2025-07-15 15:55:23 -05:00
logging Speed up MAS token introspection (#18357) 2025-06-16 16:41:35 +01:00
media Update URL Preview code to work with lxml 6.0.0 (#18622) 2025-07-15 15:04:29 +01:00
metrics Refactor Measure block metrics to be homeserver-scoped (v2) (#18601) 2025-07-15 15:55:23 -05:00
module_api Refactor Measure block metrics to be homeserver-scoped (v2) (#18601) 2025-07-15 15:55:23 -05:00
push Refactor Measure block metrics to be homeserver-scoped (v2) (#18601) 2025-07-15 15:55:23 -05:00
replication Refactor Measure block metrics to be homeserver-scoped (v2) (#18601) 2025-07-15 15:55:23 -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 Advertise support for Matrix v1.12 (#18647) 2025-07-15 15:07:20 +01:00
server_notices Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
spam_checker_api Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
state Refactor Measure block metrics to be homeserver-scoped (v2) (#18601) 2025-07-15 15:55:23 -05:00
static Update link to the clients webpage, fix #15825 (#15874) 2023-07-06 17:28:09 +02:00
storage Refactor Measure block metrics to be homeserver-scoped (v2) (#18601) 2025-07-15 15:55:23 -05:00
streams Fix regression when bounding future tokens (#17391) 2024-07-02 14:06:36 +01:00
synapse_rust Replace PyICU with Rust icu_segmenter crate (#18553) 2025-07-03 11:12:12 +01:00
types Add plain-text handling for rich-text topics as per MSC3765 (#18195) 2025-07-09 14:13:54 -05:00
util Refactor Measure block metrics to be homeserver-scoped (v2) (#18601) 2025-07-15 15:55:23 -05:00
__init__.py Remove support for python 3.8 (#17908) 2024-11-06 19:36:01 +00:00
_pydantic_compat.py import pydantic objects from the _pydantic_compat module (#17667) 2024-09-11 21:01: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 Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054) 2021-10-13 08:42:41 +01:00
server.py Add report user API from MSC4260 (#18120) 2025-06-20 13:02:14 +01:00
visibility.py Allow admins to see soft failed events (if they want to) (#18238) 2025-07-14 16:55:19 +01:00