From 2ffea4fe73b7b53708e481da6af4e37c05bfe694 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Mon, 10 Feb 2025 17:57:19 +0900 Subject: [PATCH] Update docs/configuring-playbook-matrix-media-repo.md: copy metrics section from configuring-playbook-bridge-hookshot.md Signed-off-by: Suguru Hirahara --- .../configuring-playbook-matrix-media-repo.md | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/docs/configuring-playbook-matrix-media-repo.md b/docs/configuring-playbook-matrix-media-repo.md index a4f1af80a..fa0f33eba 100644 --- a/docs/configuring-playbook-matrix-media-repo.md +++ b/docs/configuring-playbook-matrix-media-repo.md @@ -19,6 +19,42 @@ matrix_media_repo_enabled: true By default, the media-repo will use the local filesystem for data storage. You can alternatively use a `s3` cloud backend as well. Access token caching is also enabled by default since the logout endpoints are proxied through the media repo. +### Enable metrics + +The playbook can enable and configure the metrics of the service for you. + +Metrics are **only enabled by default** if the builtin [Prometheus](configuring-playbook-prometheus-grafana.md) is enabled (by default, Prometheus isn't enabled). If so, metrics will automatically be collected by Prometheus and made available in Grafana. You will, however, need to set up your own Dashboard for displaying them. + +To enable the metrics, add the following configuration to your `vars.yml` file: + +```yaml +# Expose metrics (locally, on the container network). +matrix_hookshot_metrics_enabled: true +``` + +**To collect metrics from an external Prometheus server**, besides enabling metrics as described above, you will also need to enable metrics exposure on `https://matrix.example.com/metrics/hookshot` by adding the following configuration to your `vars.yml` file: + +```yaml +matrix_hookshot_metrics_proxying_enabled: true +``` + +By default metrics are exposed publicly **without** password-protection. To password-protect the metrics with dedicated credentials, add the following configuration to your `vars.yml` file: + +```yaml +matrix_hookshot_container_labels_metrics_middleware_basic_auth_enabled: true +matrix_hookshot_container_labels_metrics_middleware_basic_auth_users: '' +``` + +To `matrix_hookshot_container_labels_metrics_middleware_basic_auth_users`, set the Basic Authentication credentials (raw `htpasswd` file content) used to protect the endpoint. See https://doc.traefik.io/traefik/middlewares/http/basicauth/#users for details about it. + +**Note**: alternatively, you can use `matrix_metrics_exposure_enabled` to expose all services on this `/metrics/*` feature, and you can use `matrix_metrics_exposure_http_basic_auth_enabled` and `matrix_metrics_exposure_http_basic_auth_users` to password-protect the metrics of them. See [this section](configuring-playbook-prometheus-grafana.md#collecting-metrics-to-an-external-prometheus-server) for more information. + +#### Enable Grafana (optional) + +Probably you wish to enable Grafana along with Prometheus for generating graphs of the metics. + +To enable Grafana, see [this section](configuring-playbook-prometheus-grafana.md#adjusting-the-playbook-configuration-grafana) for instructions. + ### Extending the configuration There are some additional things you may wish to configure about the component.