Description
pg_stat_monitor.client_ip is always 127.0.0.1, even though pg_stat_activity.client_addr has correct IPs that are not 127.0.0.1
Expected Results
See the same IP in pg_stat_monitor.client_ip and pg_stat_activity.client_addr
Actual Results
All values for client_ip are 127.0.0.1
Version
- PostgreSQL 17.2 - Percona Server for PostgreSQL 17.2.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 14.2.1 20240801 (Red Hat 14.2.1-1), 64-bit
- pg_stat_monitor 2.1
Steps to reproduce
- Install the extention:
git clone https://github.com/percona/pg_stat_monitor.git /tmp/pg_stat_monitor && \
cd /tmp/pg_stat_monitor && \
make USE_PGXS=1 && make USE_PGXS=1 install && \
cd && \
rm -rf /tmp/pg_stat_monitor
- Apply extention
ALTER SYSTEM SET shared_preload_libraries = 'pg_stat_monitor';
/usr/pgsql-17/bin/pg_ctl reload
/usr/pgsql-17/bin/pg_ctl restart
CREATE EXTENSION pg_stat_monitor;
- verify client IP is not 127.0.0.1:
SELECT DISTINCT client_addr FROM pg_stat_activity;
- Run any query.
- The query should appear in
pg_stat_monitor with the correct IP:
SELECT DISTINCT client_ip FROM pg_stat_monitor;
Relevant logs
Code of Conduct
Description
pg_stat_monitor.client_ipis always 127.0.0.1, even thoughpg_stat_activity.client_addrhas correct IPs that are not 127.0.0.1Expected Results
See the same IP in
pg_stat_monitor.client_ipandpg_stat_activity.client_addrActual Results
All values for
client_ipare 127.0.0.1Version
Steps to reproduce
pg_stat_monitorwith the correct IP:Relevant logs
Code of Conduct