Tracking important metrics over time
The pg_statviz
extension can take snapshots of important PostgreSQL cumulative and dynamic statistics so you can track them over time, perform analyses, and produce visualizations to aid your understanding of your server’s workload. The key benefit of this extension is that it’s very lightweight and does not require a module in shared_preload_libraries
– therefore, installation does not require a server restart. Finally, it enables this analysis without the overhead of external tools or storage such as Prometheus, Logstash, or Elasticsearch.
Getting ready
You can install the extension by downloading it from the PostgreSQL community repositories with your Linux distribution’s package manager by installing the package pg_statviz_extension
. Alternatively, you can install it from PGXN (the PostgreSQL Extension Network).
Then the extension must be enabled in the desired database through the CREATE EXTENSION
command...