
- #NEOLOAD POSTGRES MONITOR INSTALL#
- #NEOLOAD POSTGRES MONITOR FULL#
- #NEOLOAD POSTGRES MONITOR PASSWORD#
NB! Note that there might not be an exact Postgres version match for helper definitions - then replace $pgver with the previousĪvailable version number below your server’s Postgres version number. Psql -f /etc/pgwatch2/metrics/00_helpers/get_sequences/$pgver/metric.sql mydb Psql -f /etc/pgwatch2/metrics/00_helpers/get_stat_statements/$pgver/metric.sql mydb Psql -f /etc/pgwatch2/metrics/00_helpers/get_wal_size/$pgver/metric.sql mydb Psql -f /etc/pgwatch2/metrics/00_helpers/get_stat_replication/$pgver/metric.sql mydb

NB! When monitoring v10+ servers then the built-in pg_monitor system role is recommended for the monitoring user, whichĪlmost substitutes superuser privileges for monitoring purposes in a safe way.įor completely unprivileged monitoring users the following helpers are recommended to make good use of the default For that use case there’s also a preset config Without these additional steps, you lose though aboutġ0-15% of built-in metrics, which might not be too tragical nevertheless. For local (push) setups as of pgwatch2 versionġ.8.4 the most typical OS metrics are covered by the “–direct-os-stats” flag, explained below.įor unprivileged monitoring users it is highly recommended to take these additional steps on the “to be monitored”ĭatabase to get maximum value out of pgwatch2 in the long run.
#NEOLOAD POSTGRES MONITOR FULL#
If using a superuser login (recommended only for local “push” setups) you have full access toĪll Postgres metrics and would need helpers only for OS remote statistics. Metrics (like active session details, “per query” statistics) or even OS-level metrics, to normal unprivileged users, like the pgwatch2 Via such wrapper functions one can do controlled privilege escalation - i.e. Helper functions in pgwatch2 context are standard Postgres stored procedures, running under SECURITY DEFINER privileges.
#NEOLOAD POSTGRES MONITOR INSTALL#

How many queries are executed per second for example. Pg_stat_statements extension which will give us exact “per query” performance aggregates and also enables to calculate

#NEOLOAD POSTGRES MONITOR PASSWORD#
CREATE ROLE pgwatch2 WITH LOGIN PASSWORD 'secret' - NB! For critical databases it might make sense to ensure that the user account - used for monitoring can only open a limited number of connections - (there are according checks in code, but multiple instances might be launched) ALTER ROLE pgwatch2 CONNECTION LIMIT 3 GRANT pg_monitor TO pgwatch2 // v10 + GRANT CONNECT ON DATABASE mydb TO pgwatch2 GRANT USAGE ON SCHEMA public TO pgwatch2 - NB! pgwatch doesn't necessarily require using the public schema though! GRANT EXECUTE ON FUNCTION pg_stat_file ( text ) to pgwatch2 - needed by the wal_size metricįor most monitored databases it’s extremely beneficial (to troubleshooting performance issues) to also activate the
