Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 73f0978

Browse files
authored
Add listener health (#14747)
Fixes: #8780
1 parent 7b3a8f2 commit 73f0978

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

changelog.d/14747.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add a dedicated listener configuration for `health` endpoint.

docs/usage/configuration/config_documentation.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,12 @@ Valid resource names are:
480480

481481
* `static`: static resources under synapse/static (/_matrix/static). (Mostly useful for 'fallback authentication'.)
482482

483+
* `health`: the [health check endpoint](../../reverse_proxy.md#health-check-endpoint). This endpoint
484+
is by default active for all other resources and does not have to be activated separately.
485+
This is only useful if you want to use the health endpoint explicitly on a dedicated port or
486+
for [workers](../../workers.md) and containers without listener e.g.
487+
[application services](../../workers.md#notifying-application-services).
488+
483489
Example configuration #1:
484490
```yaml
485491
listeners:

synapse/app/generic_worker.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ def _listen_http(self, listener_config: ListenerConfig) -> None:
199199
"A 'media' listener is configured but the media"
200200
" repository is disabled. Ignoring."
201201
)
202+
elif name == "health":
203+
# Skip loading, health resource is always included
204+
continue
202205

203206
if name == "openid" and "federation" not in res.names:
204207
# Only load the openid resource separately if federation resource

synapse/app/homeserver.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ def _listener_http(
9696
# Skip loading openid resource if federation is defined
9797
# since federation resource will include openid
9898
continue
99+
if name == "health":
100+
# Skip loading, health resource is always included
101+
continue
99102
resources.update(self._configure_named_resource(name, res.compress))
100103

101104
additional_resources = listener_config.http_options.additional_resources

0 commit comments

Comments
 (0)