From ee38b3aac225cb99b11e4c1b9eb9fad9627e8357 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Mon, 13 Jul 2026 13:21:19 +0300 Subject: [PATCH] Grant pg_monitor to the prometheus-postgres-exporter database user The exporter's wal collector (enabled by default) calls pg_ls_waldir(), which Postgres restricts to superusers and members of the pg_monitor role. The exporter user is created as a plain managed-database user, so scraping logged "permission denied for function pg_ls_waldir" on every run. Grant pg_monitor via the managed database's additional_sql_queries, which the Postgres role applies both on initial creation and on subsequent runs, covering existing installations too. Fixes #3039 Co-Authored-By: Claude Fable 5 --- group_vars/matrix_servers | 1 + 1 file changed, 1 insertion(+) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 350a9f05b..31a4176c5 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -4248,6 +4248,7 @@ postgres_managed_databases_auto: | 'name': prometheus_postgres_exporter_database_name, 'username': prometheus_postgres_exporter_database_username, 'password': prometheus_postgres_exporter_database_password, + 'additional_sql_queries': ['GRANT pg_monitor TO "' + prometheus_postgres_exporter_database_username + '";'], }] if (prometheus_postgres_exporter_enabled and prometheus_postgres_exporter_database_hostname == postgres_connection_hostname) else []) + ([{