Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 2.66 KB

configuring-playbook-prometheus-postgres.md

File metadata and controls

37 lines (24 loc) · 2.66 KB

Enabling metrics and graphs for Postgres (optional)

Expanding on the metrics exposed by the synapse exporter and the node exporter, the playbook enables the postgres exporter that exposes more detailed information about what's happening on your postgres database.

Adjusting the playbook configuration

To enable the postgres exporter, add the following configuration to your inventory/host_vars/matrix.example.com/vars.yml file:

prometheus_postgres_exporter_enabled: true

Installing

After configuring the playbook, run it with playbook tags as below:

ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start

The shortcut commands with the just program are also available: just install-all or just setup-all

just install-all is useful for maintaining your setup quickly (2x-5x faster than just setup-all) when its components remain unchanged. If you adjust your vars.yml to remove other components, you'd need to run just setup-all, or these components will still remain installed. Note these shortcuts run the ensure-matrix-users-created tag too.

What does it do?

Name Description
prometheus_postgres_exporter_enabled Enable the postgres prometheus exporter. This sets up the docker container, connects it to the database and adds a 'job' to the prometheus config which tells prometheus about this new exporter. The default is 'false'
prometheus_postgres_exporter_database_username The 'username' for the user that the exporter uses to connect to the database. The default is 'matrix_prometheus_postgres_exporter'
prometheus_postgres_exporter_database_password The 'password' for the user that the exporter uses to connect to the database. By default, this is auto-generated by the playbook
prometheus_postgres_exporter_container_labels_traefik_enabled If set to true, exposes the Postgres exporter metrics on https://matrix.example.com/metrics/postgres-exporter for usage with an external Prometheus server. To password-protect the metrics, see matrix_metrics_exposure_http_basic_auth_users on that other documentation page.

More information