The main focus of this ticket should be learning about the postgres autovacuum process and identifying what things we would want to track related to autovacuum in PDB. If we can identify a few core metrics we care about we could add a periodic task to check these and log warnings if PDB detects that things aren't healthy. For example, one thing we'll want to check is overall table bloat. This can be accomplished by running the following query:
select n_dead_tup, n_live_tup, last_autovacuum |
from pg_stat_user_tables;
|
Some metrics for postgres are already collected in the puppetlabs-puppet_metrics_collector module. Recently changes were made to this module in PR 71 to gather more postgres metrics. The changes in the psql_metrics file of that PR could be a useful starting place when looking for the types of things we might want to gather in PDB periodically. |