Frequently Asked Questions
It’s a metrics collector and visualization solution for PostgreSQL databases.
Exactly so! The software falls under the BSD 3-Clause Revised License so use it however you like – privately, commercially, make modifications.
There are two ways – the simplest way is to use the public Docker image, which literally takes a minute to get metrics gathering going. The other option is to do a custom setup, by compiling the metrics collector written in Go and setting up or re-using the required external components – Grafana and InfluxDB.
Simplicity and the fact that user is in control and can change almost everything without
programming. The filosophy behind the tool could alos be expressed as – getting the 80% benefit on monitoring with 20% of effort.
First of all, you need to decide if you wan’t to run a central PostgreSQL configuration database storing connection strings of monitored databases (this is how it works when using the Docker image) or you want to work with configuration files, in so called “file based” mode. In first case you can utilize the Web UI to insert the connection string to the to-be-monitored database with a couple of clicks (or via SQL directly), in the second case you need to change a configuration YAML file on the monitoring server(s), where pgwatch is running. In both cases changes will become effective automatically.
Adding metrics is quite easy as metrics are gathered via normal SQL queries, usually involving PostgreSQL internal statistics collector views. In the default setup just go to Web UI “metrics” tab and and insert a new metric by modifying the template query. Then this metric’s name must also be added to some monitored databases config or to a preset config (collection of metrics).