Skip to content

client_ip is always 127.0.0.1 #519

@illes

Description

@illes

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

  1. 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
    
  2. 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;
    
  3. verify client IP is not 127.0.0.1:
    SELECT DISTINCT client_addr FROM pg_stat_activity;
  4. Run any query.
  5. 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

  • I agree to follow Percona Community Code of Conduct

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions