summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2020-04-27 21:36:47 +0200
committerGitHub <noreply@github.com>2020-04-27 21:36:47 +0200
commit036fab5d8adc8fbafc6cdca5a29c7361b697a6e2 (patch)
treee2ac25dd69d9142425954b79d944e664c864d4e9
parentAdd some explanation to application_services.md (#7091) (diff)
downloadsynapse-036fab5d8adc8fbafc6cdca5a29c7361b697a6e2.tar.xz
Document monitoring workers (#7357)
It doesn't seem to be documented anywhere and means that you suddenly start losing metrics without any obvious reason when you go from monolith to workers (e.g. #7312).
-rw-r--r--changelog.d/7357.doc1
-rw-r--r--docs/metrics-howto.md25
2 files changed, 26 insertions, 0 deletions
diff --git a/changelog.d/7357.doc b/changelog.d/7357.doc
new file mode 100644
index 0000000000..a3d5616ad2
--- /dev/null
+++ b/changelog.d/7357.doc
@@ -0,0 +1 @@
+Add documentation on monitoring workers with Prometheus.
diff --git a/docs/metrics-howto.md b/docs/metrics-howto.md
index 32abb9f44e..cf69938a2a 100644
--- a/docs/metrics-howto.md
+++ b/docs/metrics-howto.md
@@ -60,6 +60,31 @@
 
 1.  Restart Prometheus.
 
+## Monitoring workers
+
+To monitor a Synapse installation using
+[workers](https://github.com/matrix-org/synapse/blob/master/docs/workers.md),
+every worker needs to be monitored independently, in addition to
+the main homeserver process. This is because workers don't send
+their metrics to the main homeserver process, but expose them
+directly (if they are configured to do so).
+
+To allow collecting metrics from a worker, you need to add a
+`metrics` listener to its configuration, by adding the following
+under `worker_listeners`:
+
+```yaml
+ - type: metrics
+   bind_address: ''
+   port: 9101
+```
+
+The `bind_address` and `port` parameters should be set so that
+the resulting listener can be reached by prometheus, and they
+don't clash with an existing worker.
+With this example, the worker's metrics would then be available
+on `http://127.0.0.1:9101`.
+
 ## Renaming of metrics & deprecation of old names in 1.2
 
 Synapse 1.2 updates the Prometheus metrics to match the naming