4e2780ff88
This commit introduces a new role that downloads and installs the prometheus community postgres exporter https://github.com/prometheus-community/postgres_exporter. A new credential is added to matrix_postgres_additional_databases that allows the exporter access to the database to gather statistics. A new dashboard was added to the grafana role, with some refactoring to enable the dashboard only if the new role is enabled. I've included some basic instructions for how to enable the role in the Docs section. In terms of testing, I've tested enabling the role, and disabling it to make sure it cleans up the container and systemd role.
1.6 KiB
1.6 KiB
Enabling metrics and graphs for Postgres (optional)
Expanding on the metrics exposed by the syapse exporter and the node exporter, the playbook enables the postgres exporter that exposes more detailed information about what's happening on your postgres database.
You can enable this with the following settings in your configuration file (inventory/host_vars/matrix.<your-domain>/vars.yml
):
matrix_prometheus_postgres_exporter_enabled: true
# the role creates a postgres user as credential. You can configure these if required:
matrix_prometheus_postgres_exporter_database_username: 'matrix_prometheus_postgres_exporter'
matrix_prometheus_postgres_exporter_database_password: 'some-password'
What does it do?
Name | Description |
---|---|
matrix_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' |
matrix_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' |
matrix_prometheus_postgres_exporter_database_password |
The 'username' for the user that the exporter uses to connect to the database. |
More information
- The PostgresSQL dashboard (generic postgres dashboard)