Troubleshooting

Troubleshooting Self-Hosted

Self-managed PostgreSQL issues: shared_preload_libraries, pg_hba.conf, helper function grants.

shared_preload_libraries change not taking effect

You edited shared_preload_libraries but SHOW shared_preload_libraries; still returns the old value. Three things to check:

  • You must restart, not reload. pg_ctl restart or systemctl restart postgresql. A reload (SELECT pg_reload_conf();) doesn't pick up SPL changes.
  • Verify the new value with SHOW shared_preload_libraries; after the restart. If it's missing entries you added, something's overriding.
  • Check for a postgresql.auto.conf file overriding your postgresql.conf. ALTER SYSTEM writes to this file and it takes precedence. If something earlier did ALTER SYSTEM SET shared_preload_libraries = '...', it'll override the conf file every restart.

pg_hba.conf rejecting MonPG monitor

For agent mode running on the same host:

host    all    monpg_monitor   127.0.0.1/32    scram-sha-256

For hosted mode, allow our egress range or your VPN range:

host    all    monpg_monitor   20.107.185.112/29   scram-sha-256

After editing pg_hba.conf, run SELECT pg_reload_conf(); — no full restart needed for hba changes.

Helper functions missing

If the Tables or Indexes pages show partial data, the monpg schema's helper functions probably weren't created in every monitored DB. Check with:

\c mydb
\dn monpg
\df monpg.*

You should see get_column_stats and get_relation_stats_ext. If they're missing, re-run the bootstrap script — Settings → Servers → Generate provisioning SQL gives you the current version.

pg_stat_statements view returns rows but UI is empty

Most likely track_io_timing is off. A lot of MonPG metrics depend on it because the I/O latency component lives there. Enable:

ALTER SYSTEM SET track_io_timing = on;
SELECT pg_reload_conf();

The UI starts populating within a couple of cycles after the reload.

Log file unreachable from collector

If you point MONPG_LOG_FILE at the postgres log, the collector's OS user must have read on that path. Two ways to fix it. Set the file mode to 644 (world-readable for that file, which is fine for most setups). Or run the collector as the postgres user — gives the collector more privilege than necessary, so prefer the file-mode approach unless you have a specific reason.

For the pg_read_file path (where the collector reads logs through a Postgres function rather than the filesystem), grant the role permission as superuser:

GRANT pg_read_server_files TO monpg_monitor_<hex>;