From 82de39073ea5eb824f8414707c62051c7802760a Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Tue, 7 May 2024 09:58:00 -0600 Subject: [PATCH] docs(inputs.postgresql): Add permissions section (#15302) --- plugins/inputs/postgresql/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/inputs/postgresql/README.md b/plugins/inputs/postgresql/README.md index 4c00aba3b..3e1618131 100644 --- a/plugins/inputs/postgresql/README.md +++ b/plugins/inputs/postgresql/README.md @@ -110,6 +110,19 @@ databases are gathered. Do NOT use with the 'ignored_databases' option. databases = ["app_production", "testing"]` ``` +### Permissions + +The plugins gathers metrics from the `pg_stat_database` and `pg_stat_bgwriter` +views. To grant a user access to the views run: + +```sql +GRANT pg_read_all_stats TO user; +``` + +See the [PostgreSQL docs][] for more information on the predefined roles. + +[PostgreSQL docs]: https://www.postgresql.org/docs/current/predefined-roles.html + ### TLS Configuration Add the `sslkey`, `sslcert` and `sslrootcert` options to your DSN: