1
0
mirror of https://github.com/prometheus-community/postgres_exporter.git synced 2026-10-23 12:08:57 +03:00
Files
postgres_exporter/README-RDS.md
Arthur Silva Sens 15beb33448 Refactor pg_settings into a standalone collector (#1303)
* Refactor pg_settings into a standalone collector

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Fix linter

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

---------

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
2026-05-16 21:56:25 -04:00

1.5 KiB

Using Postgres-Exporter with AWS:RDS

When using postgres-exporter with Amazon Web Services' RDS, the

rolname "rdsadmin" and datname "rdsadmin" must be excluded.

I had success running docker container 'quay.io/prometheuscommunity/postgres-exporter:latest' with queries.yaml as the PG_EXPORTER_EXTEND_QUERY_PATH. errors mentioned in issue#335 appeared and I had to modify the 'pg_stat_statements' query with the following: WHERE t2.rolname != 'rdsadmin'

Running postgres-exporter in a container like so:

DBNAME='postgres'
PGUSER='postgres'
PGPASS='psqlpasswd123'
PGHOST='name.blahblah.us-east-1.rds.amazonaws.com'
docker run --rm --detach \
    --name "postgresql_exporter_rds" \
    --publish 9187:9187 \
    --volume=/etc/prometheus/postgresql-exporter/queries.yaml:/var/lib/postgresql/queries.yaml \
    -e DATA_SOURCE_NAME="postgresql://${PGUSER}:${PGPASS}@${PGHOST}:5432/${DBNAME}?sslmode=disable" \
    -e PG_EXPORTER_EXCLUDE_DATABASES=rdsadmin \
    -e PG_EXPORTER_DISABLE_DEFAULT_METRICS=true \
    -e PG_EXPORTER_EXTEND_QUERY_PATH='/var/lib/postgresql/queries.yaml' \
    quay.io/prometheuscommunity/postgres-exporter \
    --no-collector.settings

Expected changes to RDS: